RESULT_CACHE_MAX_SIZE=500M /* Megabytes
RESULT_CACHE_MAX_RESULT=20 /* Percentage
RESULT_CACHE_REMOTE_EXPIRATION=3600 /* Minutes
但是在 result_cache_mode 为force 的时候才会去保存所有的查询,在manual 的时候需要+HINT 来enable .
点击(此处)折叠或打开
- alter session set result_cache_mode=force;
点击(此处)折叠或打开
- show parameter result_cache
- NAME TYPE VALUE
- ------------------------------------ ----------- ------------------------------
- client_result_cache_lag big integer 3000
- client_result_cache_size big integer 0
- result_cache_max_result integer 5
- result_cache_max_size big integer 5984K
- result_cache_mode string MANUAL
- result_cache_remote_expiration integer 0
点击(此处)折叠或打开
- SQL> SET SERVEROUTPUT ON
- SQL> execute dbms_result_cache.memory_report
- R e s u l t C a c h e M e m o r y R e p o r t
- [Parameters]
- Block Size = 1K bytes
- Maximum Cache Size = 5984K bytes (5984 blocks)
- Maximum Result Size = 299K bytes (299 blocks)
- [Memory]
- Total Memory = 174752 bytes [0.027% of the Shared Pool]
- ... Fixed Memory = 10696 bytes [0.002% of the Shared Pool]
- ... Dynamic Memory = 164056 bytes [0.026% of the Shared Pool]
- ....... Overhead = 131288 bytes
- ....... Cache Memory = 32K bytes (32 blocks)
- ........... Unused Memory = 30 blocks
- ........... Used Memory = 2 blocks
- ............... Dependencies = 1 blocks (1 count)
- ............... Results = 1 blocks
- ................... SQL = 1 blocks (1 count)
- PL/SQL procedure successfully completed.