我们都知道:oracle有3中buffer pool
1. default pool
2. keep pool
3. recycle pool
对于这三种pool,是基于block的热度来进行管理的,系统默认使用的,就用default pool了,还有一些热块,居于其次的,就放到keep pool,对于一些比较大的对象,不太常用应该使它们尽快退出pool,就可以放到recycle pool;
craete table ...storage(buffer_pool default/keep/recycle);
这三种pool相互是独立的,管理算法也是相同的,不同的就是用来cache不同热度的block,从而让其他的block能够更久的呆在default pool中;
alter table cache语句并不能够把该表cache到pool中,它只是修改了该表在pool中被管理的方式;通常情况下,对于FTS对象,oracle总是把相应的block放到低端(LRU)--尽快退出pool,如果对table执行了alter table cache,那么做FTS时,相应的block会被放到高端(MRU)--呆在pool中的时间会更长些;
SQL> create table test(c1 int);
Table created.
SQL> select table_name,cache from user_tables where table_name = 'TEST';
TABLE_NAME CACHE
------------------------------ --------------------
TEST N
SQL> alter table test cache;
Table altered.
SQL> select table_name,cache from user_tables where table_name = 'TEST';
TABLE_NAME CACHE
------------------------------ --------------------
TEST Y
SQL> create table test1(c1 int) cache;
Table created.
SQL> select table_name,cache from user_tables where table_name = 'TEST1';
TABLE_NAME CACHE
------------------------------ --------------------
TEST1 Y
SQL>
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/45259/viewspace-659551/ ,如需转载,请注明出处,否则将追究法律责任。