2017-04-13 DBA日记,当sga_target=0 和memory_target=0还会自动调整内存的研究

背景:
今天发现我管理的数据库DB1,当sga_target=0 和memory_target=0时,db_cache_size与shared_pool_size还是会自动调整,这样严重影响数据库的性能状况。
db:oracle 11.2.0.3 for aix
os:aix
问题:
为什么当sga_target=0 和memory_target=0时,db_cache_size与shared_pool_size还是会自动调整?
分析:
1)查询support oracle是不是一个bug?还是我配置不当所置。
SGA Re-Sizes Occurring Despite AMM/ASMM Being Disabled (MEMORY_TARGET/SGA_TARGET=0) (文档 ID 1269139.1)

In this Document
Symptoms
Changes
Cause
Solution
References

APPLIES TO:

Oracle Database - Enterprise Edition - Version 11.2.0.1 and later
Oracle Database - Standard Edition - Version 11.2.0.3 to 11.2.0.3 [Release 11.2]
Information in this document applies to any platform.
***Checked for relevance on 02-Nov-2015***
SYMPTOMS

SGA re-sizes are occurring after upgrade to 11.2 despite the fact that automatic memory management (AMM/ASMM) is disabled via the MEMORY_TARGET and SGA_TARGET parameters being set to zero. This typically appears as growth in the __SHARED_POOL_SIZE value and a reduction in the __DB_CACHE_SIZE value being used in the instance, such that __DB_CACHE_SIZE may be shrunk below the DB_CACHE_SIZE value specified in the init.ora/spfile.

Checking V$MEMORY_RESIZE_OPS / V$SGA_RESIZE_OPS shows an IMMEDIATE re-size having occurred, e.g.:

COMPONENT OPER_TYPE OPER_MODE PARAMETER INITIAL_SIZE TARGET_SIZE FINAL_SIZE STATUS START_TIME END_TIME
---------------------- ---------- --------- ----------------- ------------ ----------- ---------- --------- -------------------- --------------------
DEFAULT buffer cache SHRINK IMMEDIATE db_cache_size 7.4357E+10 7.4088E+10 7.4088E+10 COMPLETE 12-OCT-2010 14:26:51 12-OCT-2010 14:26:51
shared pool GROW IMMEDIATE shared_pool_size 2684354560 2952790016 2952790016 COMPLETE 12-OCT-2010 14:26:51 12-OCT-2010 14:26:51

CHANGES

The database has been upgraded to 11.2.

CAUSE

This is expected behavior in 11.2 for immediate memory allocation requests, which added this as a new feature when automatic memory management was disabled. Enhancement Bug 13340694 has been logged to provide a warning message in the alertlog when such allocations occur to provide the DBA with an indication of a memory problem, as otherwise this can result in the buffer cache being shrunk below the specified minimum value, and hence lead to performance degradation.

SOLUTION

o Ignore the resize operation which is performed to prevent an ORA-4031 error from being raised,

- OR -

o Set the parameter _MEMORY_IMM_MODE_WITHOUT_AUTOSGA=false in the instance to disable this feature with the consequence that in future an ORA-4031 error could be raised, e.g.:

connect / as sysdba
alter system set "_memory_imm_mode_without_autosga"=FALSE scope=both;
exit

Documentation Bug 12434622 addresses this change in 12c for the MEMORY_TARGET and SGA_TARGET parameters by specifying:

Default value 0 (SGA autotuning is disabled for DEFERRED mode autotuning requests, but allowed for IMMEDIATE mode autotuning requests)

Note that a high number of Immediate re-sizes indicates a problem with the shared pool or possibly SGA being too small.
For a discussion of monitoring the shared pool, please refer to:
Note 396940.1 - Troubleshooting and Diagnosing ORA-4031 Error [Video]

REFERENCES

BUG:10205994 - SGA RE-SIZES OCCURRING EVEN THOUGH AMM/ASMM ARE DISABLED
BUG:12434622 - AUTO-TUNING OF SHARED MEMORY IS STILL DONE WHILE SGA_TARGET/MEMORY_TARGET=0
BUG:13340694 - PROVIDE WARNING IN ALERT LOG OF IMMEDIATE MODE AUTOTUNING REQUESTS
NOTE:396940.1 - Troubleshooting and Diagnosing ORA-4031 Error [Video]
2)果然击中一个bug,根据oracle官方文档修复。

解决方案:
connect / as sysdba
#备份spfile
create pfile from spfile
#修改隐藏参数
alter system set "_memory_imm_mode_without_autosga"=FALSE scope=both;
#重新设定的oracle同存参数
alter system set db_cache_size=36G scope=spfile;
alter system set shared_pool_size = 10 G scope=spfile;
shutdown immediate
startup

你可能感兴趣的:(ORACLE,DBA)