Monday, January 12, 2009

ORA-32010: cannot find entry to delete in SPFILE

Error Description
With ALTER SYSTEM SET ..... SID='*' we can set the parameter value to all instances of the database( Like in RAC). But to set parameter only to a single instance of a database we use ALTER SYSTEM SET ..... SID='instance_name';

Similarly to reset a parameter value from all instances we have to use ALTER SYSTEM RESET ... sid='*' and to reset a parameter value from a single instance we have to use ALTER SYSTEM RESET ..... sid='instance_name'.

Now while we reset value from a single instance it fails with error ORA-32010.
SQL> alter system reset open_cursors scope=both sid='shaik';
alter system reset open_cursors scope=both sid='shaik'
*
ERROR at line 1:
ORA-32010: cannot find entry to delete in SPFILE

Cause and Solution of The Problem
Inside the spfile if you notice the parameter is set for all instances. That is with *. Oracle try to finds/looks in spfile for parameter with name shaik.open_cursors but could not find that and so can't reset that and error comes.
Here is that,

SQL> create pfile='/oradata2/mynewpfile' from spfile;
File created.

SQL> !vi /oradata2/mynewpfile
*.open_cursors=300

However if there is an entry inside spfile with shaik.open_cursors then it would work fine and the ALTER SYSTEM RESET open_cursors scope=both sid='shaik' would work fine.

We can test is by modifying pfile manually and then spfile.
SQL> shutdown abort
ORACLE instance shut down.

SQL> create spfile from pfile='/oradata2/mynewpfile';
File created.

SQL> startup
ORACLE instance started.

Total System Global Area 234881024 bytes
Fixed Size 2019800 bytes
Variable Size 121638440 bytes
Database Buffers 104857600 bytes
Redo Buffers 6365184 bytes
Database mounted.
Database opened.

SQL> alter system reset open_cursors scope=both sid='shaik';
System altered.

We could also be able to do the test in the spfile itself. Like,

SQL> alter system reset open_cursors scope=both sid='shaik';
alter system reset open_cursors scope=both sid='shaik'
*
ERROR at line 1:
ORA-32010: cannot find entry to delete in SPFILE

SQL> alter system set open_cursors=400 scope=both sid='shaik';
System altered.


SQL> alter system reset open_cursors scope=both sid='shaik';

System altered.

However if you want to want to reset the memort value for instance * from instance shaik it will fail with error ORA-32009.

SQL> alter system reset open_cursors scope=both sid='*';
alter system reset open_cursors scope=both sid='*'
*
ERROR at line 1:
ORA-32009: cannot reset the memory value for instance * from instance shaik

In that case we can be able to only reset it from spfile like,
SQL> alter system reset open_cursors scope=spfile sid='*';
System altered.

No comments:

Post a Comment