Saturday 26 March 2016

SPFILE (RAC/ASM)


1.Create pfile from spfile
2.Edit pfile and adjust value causing this issue
3.Start the database up with nomount option
4.Create spfile from pfile
5.Adjust ASM alias
6.Bounce the database
7.Remove old spfile from ASM


Steps should be on a single node only.



1)      Create pfile from spfile

create pfile=’/u02/initracdb_singleNODE.ora’ from spfile=’+OCR/rac-cluster/asmparameterfile/registry.253.874451309';
or
create pfile=’/u02/initracdb_singleNODE.ora’ from spfile;


For pfile, you need to specify a location, otherwise it will overwrite your pfile in $ORACLE_HOME/dbs, which will further complicate your recovery.



 For spfile, you need to find where your spfile file is on ASM, remember your database is not even mounted, so Oracle is totally lost as where the location of database’s spfile is.



2)      Edit pfile

 Now change value causing violation.



3)    Start the database up with nomount option

Startup nomount pfile=’/u02/backups/dbatst/initdbatst.ora.new’

 This should bring up the database in nomount stage.

 

4)      Create spfile from pfile

create spfile=’+DATA01' from pfile=’/u02/backups/dbatst/initdbatst.ora';

Notice now that in nomount stage, Oracle recognizes where to put the spfile and you don’t need to specify the full ASM path to spfile.

spfile Location: <+dg>/database name/parameterfile

In my situation it will be ‘+DATA01/dbatst/parameterfile’

Also note that Oracle will create a new spfile without overwriting the old one. You should delete the old spfile as indicated later.



5)      Adjust ASM alias

“Alias” in ASM is like link “ln” operating system command.



The location of spfile alias on ASM is in the pfile under $ORACLE_HOME/dbs.

The spfile alias on ASM is pointing to the old spfile file, not the new one.

To fix this issue, you need to delete old alias and recreate a new alias



Here are the commands:

asmcmd

cd to alias location, location should be ‘+dg/dbname/spfiledbname.ora’

ls -l  , just to confirm it is an alias

delete alias:

rmalias spfiledbatst.ora


recreate alias

mkalias +DATA01/DBATST/PARAMETERFILE/spfile.535.831221333 spfiledbatst.ora
 

6)      Bounce the database

Use srvctl utility to bounce the database.

After database comes up successfully, make sure it is using the spfile.

 From a sqlplus session:

      show parameter spfile



7)      Delete old spfile

Just to keep things tidy, remove the old spfile from <+dg>/database name/parameterfile






---: SPFILE Identify
sql> show parameter spfile
asmcmd spget     ---- ASM SPFILE
gpnptool
kfed read /dev/sdb3 | grep -E ‘spf|ausize’ 

No comments: