db_keep_cache_size :是否将表保存在内存中

表cache:将表放在data buffer的最常使用端,尽量避免被T出buffer,跟算法MRU和LRU有关,为两个概念;


下面是来自ASKTOM摘录内容

You Asked


Hi, 
Is it enough if we use 
ALTER TABLE <table_name> CACHE; to push the table to cache ?. 
Do I need to do anything else to have the table in the Memory ?
 
Thx, VJ



and we said...

That command simply makes a notation in the data dictionary that blocks from this table 
should be handled differently when they get into the cache.  Usually, when we full scan 
an object, we put the blocks onto the least recently end of the list.  These blocks are 
candidates for "aging" from the buffer cache.  By altering the table to 'cache', we put 
the blocks onto the most recently used end -- making them less prone to being aged out of 
the buffer cache.

From the sql reference manual we see:

...
for data that is accessed frequently, specifies that the blocks retrieved for this table 
are placed at the most recently used end of the LRU list in the buffer cache when a full 
table
scan is performed. This attribute is useful for small lookup tables. 
...

So, no -- issueing the alter table ... cache command does not put the table into memory, 
you must full scan the table for that to happen.

Consider looking into setting up multiple buffer pools and associating this table with 
its own buffer pool if you are dead serious about caching it.  Bufrer pools are 

<quote tuning manual>
Schema objects are referenced with varying usage patterns; therefore, their cache 
behavior may be quite different. Multiple buffer pools enable you to address these 
differences. You can use a KEEP buffer pool to maintain objects in the buffer cache
and a RECYCLE buffer pool to prevent objects from consuming unnecessary space in the 
cache. When an object is allocated to a cache, all blocks from that object are placed in 
that cache. Oracle maintains a DEFAULT buffer pool for objects that have
not been assigned to one of the buffer pools.
</quote>

Bear in mind tho... there is really no true way to a have a purely "in memory" table -- 
even cached tables are subject to aging from the buffer cache.