直接看实例:
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
PL/SQL Release 11.2.0.4.0 - Production
CORE 11.2.0.4.0 Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
SQL> show parameter memory
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
hi_shared_memory_address integer 0
memory_max_target big integer 632M
memory_target big integer 632M
shared_memory_address integer 0
SQL> show parameter result
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 0
result_cache_mode string MANUAL
result_cache_remote_expiration integer 0
由于是测试库给的内存比较小,比较实体机的资源有限:)
SQL> alter system set result_cache_max_size=1280K scope=spfile;
System altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 392531968 bytes
Fixed Size 2253504 bytes
Variable Size 180358464 bytes
Database Buffers 205520896 bytes
Redo Buffers 4399104 bytes
Database mounted.
Database opened.
SQL> show parameter result
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 0
result_cache_mode string MANUAL
result_cache_remote_expiration integer 0
上面讲resulte_cache_max_size设置为1280K,重启DB后又变成0了,导致这个问题的原因是:由于给定的综合总内存太小了,导致oracle无法对result_cache进行分配。
坑的是oracle啥都不提示至少在alert日志中有体现也行呀,小内存虚拟机玩的也是泪啊