Sunday, 16 March 2014

ORA-04031: unable to allocate bytes of shared memory


ORA-04031: unable to allocate  bytes of shared memory 


The ORA-04031 error has many root causes:
More shared memory is needed than was allocated in the shared pool.
You need to provide sufficient shared memory by allocating more value to shared_pool_size
sometimes it occurs when DB is in AMM mode.

Resolving the ORA-04031 error:
This can be fixed by increasing the shared_pool_size or doing a "alter system flush shared pool" or bouncing the instance.
1.First you increase the size of shared pool in init.ora and restart the database;
shared_pool_size=2G
sql>showdown immediate;
sql>startup


2.If the problem still exists then perform the below in sql prompt
sql> alter system flush shared pool;

3.make sure you have proper SGA by the below params
sga_target                           big integer 4G
sga_max_size                         big integer 4G

Note: prefer 1,3 rd steps only. in worst case use 2nd step.



 if you want to increase sga_target then go to /etc/sysctl.conf file and edit kernel.shmmax value . then SGA_TARGET can be adjusted as required.

No comments:

ORA-600 [kwqitnmphe:ltbagi], [1], [0] reported in the alert log file.

ORA-00600 [kwqitnmphe:ltbagi] Cause: This issue arises in 12.1.0.2. The error occurs because there are still Historical Messages without...