測試將表快取到keep池

parknkjun發表於2016-12-08
1、設定keep池大小
SYS@jzh>alter system set db_keep_cache_size=60m;
System altered.
2、建立測試表
JZH@jzh>create table t as select * from dba_objects;
Table created.
3、檢視執行計劃
JZH@jzh>select * from t;
74756 rows selected.
Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
       5985  consistent gets
       1065  physical reads
          0  redo size
    8574342  bytes sent via SQL*Net to client
      55336  bytes received via SQL*Net from client
       4985  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
      74756  rows processed
4、將表存放keep池中
JZH@jzh>alter table t storage (buffer_pool keep);
Table altered.
5、查詢表是否在keep池中
JZH@jzh>select table_name,buffer_pool from user_tables;
TABLE_NAME                     BUFFER_POOL
------------------------------ --------------------
T                              KEEP
6、查詢表是否被cache
JZH@jzh>select table_name,buffer_pool,cache from user_tables;
TABLE_NAME                     BUFFER_POOL          CACHE
------------------------------ -------------------- --------------------
T                              KEEP                     N
7、快取表
JZH@jzh>alter table t cache;
Table altered.
JZH@jzh>select table_name,buffer_pool,cache from user_tables;
TABLE_NAME                     BUFFER_POOL          CACHE
------------------------------ -------------------- --------------------
T                              KEEP                     Y
8、檢視執行計劃
JZH@jzh>select * from t;
74756 rows selected.
Statistics
----------------------------------------------------------
          0  recursive calls
          0  db block gets
       5987  consistent gets
          0  physical reads
          0  redo size
    8574342  bytes sent via SQL*Net to client
      55336  bytes received via SQL*Net from client
       4985  SQL*Net roundtrips to/from client
          0  sorts (memory)
          0  sorts (disk)
      74756  rows processed


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10271187/viewspace-2130063/,如需轉載,請註明出處,否則將追究法律責任。

相關文章