ITPub博客

首页 > 数据库 > Oracle > 测试将表缓存到keep池

测试将表缓存到keep池

原创 Oracle 作者:parknkjun 时间:2016-12-08 15:29:39 0 删除 编辑
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/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-02-11

  • 博文量
    113
  • 访问量
    508859