Oracle 11.2.0.1 Result Cache 测试 - 3 参数及使用,限制

2. 客户端Result Cache参数:  
CLIENT_RESULT_CACHE_SIZE 
该参数定义了单个客户端进程所使用的Result Cache最大值。如果设置为0,则关闭了客户端Result Cache技术。
该参数缺省值即为0, 即默认客户端result cache是关闭的 。 

CLIENT_RESULT_CACHE_LAG 
该参数定义客户端与服务端最后一次往返(round-trip)时间阀值,在该时间阀值内,客户端将向服务端查询客
户端Result Cache中的数据是否发生变化,该参数缺省值为3000毫秒。即每隔3秒,Oracle将客户端Result Cache
中的数据与服务端进行一次同步。

二,使用Result Cache  
1. 使用 Result Cache的方式:   
Database Setting
    result_cache_mode = FORCE (not recommended)
Query Hint
   select /*+ result_cache */ rep_name, sum(order_total)
   from orders  group by rep_name
Table Annotation Mode
     alter table order_history result_cache (mode force)
Session Mode
     alter session set result_cache_mode = force

2. 使用限制: 
Will Not Work With
Temporary tables
SYS or SYSTEM tables
Sequences (NEXTVAL or CURRVAL)
Date/Time Functions – SYSDATE, CURRENT_DATE, SYS_TIMESTAMP, CURRENT_TIMESTAMP, etc
USERENV / SYS_CONTEXT (with non-constant variables)
SYS_GUID

Query must retrieve the most current committed state of the data
No Active Transaction Against Objects in Current Session

query result based on a read-consistent snapshot of data that is older than the latest
committed version of the data will not be cached. If any of the tables used to build a
cached result has been modified in an ongoing transaction in the current session then
the result is never cached
    result cache在一致性上有严格的要求,要求进入result cache的内容必须来自于最新的已经提交
的数据块,如果当前session正在对某张表进行dml操作,且尚未commit或者rollback,那么这个session
里所有对于这张表的select结果是无法缓存在result cache里的. 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/35489/viewspace-1433510/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/35489/viewspace-1433510/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值