Saturday, July 12, 2008

ORA-02097, ORA-00384 while setting memory components

Error Description:
-----------------------------

While settings dynamic memory components ORA-00384: is raised.

SQL> alter system set db_4k_cache_size=800M;

alter system set db_4k_cache_size=800M
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-00384: Insufficient memory to grow cache

Cause of The Problem:
--------------------------------------------

This problem can be raised for several reasons.
1)SGA_MAX_SIZE is not set
--------------------------------------------------

The initialization parameter SGA_MAX_SIZE is not set explicitly either in spfile or in pfile and hence its default value at the time of startup is set to sum of the total memory parameters plus some overhead.

You can check your current sga memory by issuing any one of the following in SQL*plus,
show sga;
show parameter sga_max_size;


So, whenever you use ALTER SYSTEM SET to set the value of dynamic memory components like DB_CACHE_SIZE , DB_nK_CACHE_SIZE this will fail as it cannot grow beyond SGA_MAX_SIZE . Thus, the errors which your are seeing is expected.

2)SGA_MAX_SIZE is set but not enough to allow memory to allocate
--------------------------------------------------------------------------------

There may be explicitly set SGA_MAX_SIZE but it is not enough to allow the memory settings as it set by ALTER SYSTEM SET statement. Suppose total sga memory after setting sga dynamic components exceeds SGA_MAX_SIZE.

3)Oracle Bug
---------------------------

There is oracle Bug 4587117 and Bug 4919526 which is responsible to cause the above error.

Solution of the Problem:
----------------------------------

The solution is based on the cause of the error.
For Case 1)
Increase the SGA_MAX_SIZE parameter of the database and bounce the database. As SGA_MAX_SIZE is invoked only at startup so in order to affect the changes database need to be restarted. You can set it in spfile from sql*plus by,

ALTER SYSTEM SET SGA_MAX_SIZE=4G scope=spfile;
SHUTDOWN;
STARTUP;


For Case 2)
If you have limited memory in your system then set the lower value of the dynamic components. Suppose you tried to set 800M which raised error. You may set it lower value which will not raise error. Like,
alter system set db_4k_cache_size=300M;

For Case 3)
Install Server Patch Set from metalink.
Related Documents
http://arjudba.blogspot.com/2008/05/startup-fails-with-ora-27102-out-of.html
http://arjudba.blogspot.com/2008/12/expdp-fails-with-ora-39125-ora-04031.html
http://arjudba.blogspot.com/2009/05/ora-27100-shared-memory-realm-already.html
http://arjudba.blogspot.com/2008/05/startup-fails-with-oracle-error-ora.html
http://arjudba.blogspot.com/2008/09/database-startup-fails-with-ora-27302.html
http://arjudba.blogspot.com/2008/07/database-startup-fails-with-error-ora.html
http://arjudba.blogspot.com/2008/08/startup-fails-with-ora-01261-parameter.html

No comments:

Post a Comment