Recreating the Spfile for RAC Instances


SQL> startup mount pfile=’/u01/app/oracle/11.2.0/home/oracle/initPROD01.ora’;

The current location for spfile is; +oradata/AZKKDB/spfileAZKKDB.ora so the new file will need to replace with this file. 
ASM itself stores the spfile in +oradata/AZKKDB/PARAMETERFILE/spfile.267.737949031 and links or aliases the spfile in the location +oradata/AZKKDB/spfileAZKKDB.ora

We can also check where spfile is in ASM diskgroup by using the ASMCMD command

For example(Do not forget to set ASM env):

ASMCMD [+oradata/AZKKDB] > ls -l
Type Redund Striped Time Sys Name
Y CHANGETRACKING/
Y CONTROLFILE/
Y DATAFILE/
Y ONLINELOG/
Y PARAMETERFILE/
Y TEMPFILE/
N spfileAZKKDB.ora => +ORADATA/AZKKDB/PARAMETERFILE/spfile.267.737949031

Before start be ensure one of the database instances is mounted in RAC system to recreate the spfile.

SQL> select INSTANCE_NAME,HOST_NAME,STATUS from v$instance
INSTANCE_NAME HOST_NAME STATUS
—————- —————– ————
AZKKDB1 orapdb11 mount

Create the new spfile

SQL> create spfile=’+oradata/AZKKDB/spfileAZKKDB.ora’ from pfile=’/u01/app/oracle/11.2.0/dbs/initAZKKDB1.ora’;
File created.

ASMCMD will show that a new spfile has been created as the alias spfileAZKKDB.ora is now pointing to a new spfile under the PARAMETER directory in ASM.

ASMCMD> pwd
+oradata/AZKKDB
ASMCMD> ls -l
Type Redund Striped Time Sys Name
Y CONTROLFILE/
Y DATAFILE/
Y ONLINELOG/
Y PARAMETERFILE/
Y TEMPFILE/
N spfileAZKKDB.ora =>
+oradata/AZKKDB/PARAMETERFILE/spfile.298.731252301

Shutdown the instance and restart the database using srvctl using the newly created spfile.

SQL> shutdown immediate
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.

[oracle@node1 ~]$ srvctl start database -d AZKKDB
ASMCMD will now show a number of spfiles exist in the PARAMETERFILE directory for this database. We need to remove old spfile .

ASMCMD> pwd
+oradata/AZKKDB
ASMCMD> cd PARAMETERFILE
ASMCMD> ls -l
Type Redund Striped Time Sys Name
ASMCMD [+oradata/AZKKDB/PARAMETERFILE] > ls -l
Type Redund Striped Time Sys Name
PARAMETERFILE UNPROT COARSE DEC 18 16:00:00 Y spfile.267.737949031
PARAMETERFILE UNPROT COARSE DEC 18 16:40:00 Y spfile.298.731252301
ASMCMD> rm spfile.267.737949031
ASMCMD> ls
spfile.298.731252301

Reference:
Recreating the Spfile for RAC Instances Where the Spfile is Stored in ASM [ID 554120.1]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: