oracle的db_buffer_pool由三部分組成:
buffer_pool_defualt

buffer_pool_keep

buffer_pool_recycle

如果要把表釘死在內(nèi)存中,也就是把表釘在keep區(qū)。

 

 


--表如果緩存的話是緩存在keep區(qū)
SQL> alter table t1 storage(buffer_pool keep);

表已更改。


--查詢到放在keep區(qū)中的表,但是不意味著表已經(jīng)被緩存.
SQL> select table_name from dba_tables where buffer_pool='KEEP';

TABLE_NAME
------------------------------
T1


--將表T1緩存

SQL> alter table t1 cache;

表已更改。


--查詢到表是否已經(jīng)被緩存
SQL>select table_name from dba_tables where trim(cache)='Y';

加入到keep區(qū)的表不是說不能被移出內(nèi)存,不過是比較不容易移出內(nèi)存.


--手工將指定表移出內(nèi)存

SQL> alter table t1 nocache;

表已更改。