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里的.
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/