ITPub博客

首页 > 数据库 > Oracle > ASM Instances Are Reporting ORA-04031 Errors

ASM Instances Are Reporting ORA-04031 Errors

Oracle 作者:Curry_0316 时间:2016-01-07 10:37:12 0 删除 编辑
文章转自mos文档:
ASM Instances Are Reporting ORA-04031 Errors. (文档 ID 1370925.1)

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.2.0.1 to 11.2.0.3 [Release 10.2 to 11.2]
Information in this document applies to any platform.
Currency Check 19-Jul-2013

SYMPTOMS

ASM RAC instances are reporting ORA-04031 errors:

ERROR at line 1:
ORA-04031: unable to allocate 256 bytes of shared memory ("shared
pool","unknown object","PCursor","kglob")

CAUSE


1) ASM instance was running out of shared pool free memory.


2) The shared pool free memory was close to 0 MB on the affected ASM instances:


+ASM1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SQL> select bytes/1024/1024 MB
2 from v$sgastat
3 where pool = 'shared pool' and name = 'free memory';

MB 
17.8854446 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


+ASM2
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SQL> select bytes/1024/1024 MB
2 from v$sgastat
3 where pool = 'shared pool' and name = 'free memory';

MB 
22.6575012 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


+ASM3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SQL> select bytes/1024/1024 MB
2 from v$sgastat
3 where pool = 'shared pool' and name = 'free memory';

select bytes/1024/1024 MB
*

ERROR at line 1:
ORA-04031: unable to allocate 256 bytes of shared memory ("shared
pool","unknown object","PCursor","kglob")
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~




2) This confirms that the ASM instance are running out of shared pool free memory.

SOLUTION


1) sga_max_size has the default value = 272M 

2) You will need to increase the sga_max_size twice (in the spfile) as follow:

SQL> alter system set sga_max_size = 544M scope=spfile;



3) Then bounce the ASM RAC instances to apply the changes (it can be one ASM instance at the time (rolling shutdown) to avoid a complete outage).

4) After increase the sga_max_size, more shared pool will be dynamically allocated.

Note 1: Alternatively, as temporary workaround you can flush the Shared Pool (in the affected ASM instances) as follow:


SQL> alter system flush shared_pool;

System altered.


Note 2:  If ASM is using Automatic Memory Management (default on release 11.2), then for a permanent fix, please increase the MEMORY_MAX_TARGET and MEMORY_TARGET 50% more or so in your ASM instances.

For additional information please check the next manual:

http://docs.oracle.com/cd/E11882_01/server.112/e25494/memory.htm#ADMIN11200

=)> Oracle???? Database Administrator's Guide
11g Release 2 (11.2)
Part Number E25494-02
==)> Using Automatic Memory Management

===)> Enabling Automatic Memory Management



Note 3:  In 11.2.0.3, the "PROCESSES" parameter will be default to "available CPU cores * 80 + 40" (in the ASM spfile). As the default value for "MEMORY_TARGET" is based on "PROCESSES", it can be insufficient if there is a large number of CPU cores or large number of diskgroups which could cause issues (i.e. Grid Infrastructure stack fails to stop with ORA-04031 etc) per Bug:13605735 & Bug:12885278, it is recommended to increase the value of MEMORY_MAX_TARGET & MEMORY_TARGET before upgrading/installing to 11.2.0.3 (does not apply to 10g ASM):


Log in to ASM:


SQL> show parameter memory_target


If the value is smaller than 1536m, issue the following:


SQL> alter system set memory_max_target=4096m scope=spfile;
SQL> alter system set memory_target=1536m scope=spfile;


The number 1536m has proven to be sufficient for most environment, the change will not be effective until next restart.

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29953799/viewspace-1973048/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-10-11

  • 博文量
    89
  • 访问量
    280146