oracle 调整结果集缓存,只有3个参数。

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 .


点击(此处)折叠或打开

  1. alter session set result_cache_mode=force;

点击(此处)折叠或打开

  1. show parameter result_cache

  2. NAME                 TYPE     VALUE
  3. ------------------------------------ ----------- ------------------------------
  4. client_result_cache_lag      big integer 3000
  5. client_result_cache_size     big integer 0
  6. result_cache_max_result      integer     5
  7. result_cache_max_size         big integer 5984K
  8. result_cache_mode         string     MANUAL
  9. result_cache_remote_expiration     integer     0
查询下内存分配情况

点击(此处)折叠或打开

  1. SQL> SET SERVEROUTPUT ON
  2. SQL> execute dbms_result_cache.memory_report
  3. R e s u l t C a c h e M e m o r y    R e p o r t
  4. [Parameters]
  5. Block Size     = 1K bytes
  6. Maximum Cache Size = 5984K bytes (5984 blocks)
  7. Maximum Result Size = 299K bytes (299 blocks)
  8. [Memory]
  9. Total Memory = 174752 bytes [0.027% of the Shared Pool]
  10. ... Fixed Memory = 10696 bytes [0.002% of the Shared Pool]
  11. ... Dynamic Memory = 164056 bytes [0.026% of the Shared Pool]
  12. ....... Overhead = 131288 bytes
  13. ....... Cache Memory = 32K bytes (32 blocks)
  14. ........... Unused Memory = 30 blocks
  15. ........... Used Memory = 2 blocks
  16. ............... Dependencies = 1 blocks (1 count)
  17. ............... Results = 1 blocks
  18. ................... SQL = 1 blocks (1 count)

  19. PL/SQL procedure successfully completed.
好像只有oracle 有这个东西,DB2 和mysql 都没有。
10-12 14:51
查看更多