Views

Tuesday, December 5, 2017

RAC - Create spfile from pfile for RAC instances

Create spfile from pfile for RAC instances

The pfile is present at /u01/app/oracle/product/11.2.0/dbhome_1/dbs/initRAC.ora.
We will first start RAC with this pfile and create new spfile in ASM and restart RAC with new spfile.
Steps performed as under:

Stop the cluster.

[oracle@o1 dbs]$ srvctl stop database -d RAC
[oracle@o1 dbs]$ crsctl stat res -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       o1                                          
               ONLINE  ONLINE       o2                                          
ora.LISTENER.lsnr
               ONLINE  ONLINE       o1                                           
               ONLINE  ONLINE       o2                                          
ora.asm
               ONLINE  ONLINE       o1                       Started            
               ONLINE  ONLINE       o2                       Started             
ora.gsd
               OFFLINE OFFLINE      o1                                          
               OFFLINE OFFLINE      o2                                          
ora.net1.network
               ONLINE  ONLINE       o1                                           
               ONLINE  ONLINE       o2                                          
ora.ons
               ONLINE  ONLINE       o1                                          
               ONLINE  ONLINE       o2                                           
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       o1                                          
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       o1                                          
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       o1                                          
ora.cvu
      1        ONLINE  ONLINE       o1                                          
ora.o1.vip
      1        ONLINE  ONLINE       o1                                           
ora.o2.vip
      1        ONLINE  ONLINE       o2                                          
ora.oc4j
      1        ONLINE  ONLINE       o1                                          
ora.rac.db
      1        OFFLINE OFFLINE                               Instance Shutdown  
      2        OFFLINE OFFLINE                               Instance Shutdown  
ora.scan1.vip
      1        ONLINE  ONLINE       o1                                          
ora.scan2.vip
      1        ONLINE  ONLINE       o1                                          
ora.scan3.vip
      1        ONLINE  ONLINE       o1  

Mount one db instance.

[oracle@o1 dbs]$ . oraenv
ORACLE_SID = [+ASM1] ? RAC1

SQL> startup mount pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initRAC.ora';

SQL> select INSTANCE_NAME,HOST_NAME,STATUS from v$instance;

INSTANCE_NAME   HOST_NAME       STATUS     
--------------  -------------------- ------------
RAC1            o1.localdomain       MOUNTED


Create spfile from pfile.


SQL> create spfile='+DATA/RAC/spfileRAC.ora' from pfile='/u01/app/oracle/product/11.2.0/dbhome_1/dbs/initRAC.ora';

SQL> exit


Check in ASM if new spfile has been created.

[oracle@o1 dbs]$ . oraenv
ORACLE_SID = [RAC1] ? +ASM1

[oracle@o1 dbs]$ asmcmd
ASMCMD> cd DATA
ASMCMD> cd RAC
ASMCMD> ls -l
Type  Redund  Striped  Time Sys  Name
                            Y    CONTROLFILE/
                            Y    DATAFILE/
                            Y    ONLINELOG/
                            Y    PARAMETERFILE/
                            Y    TEMPFILE/
                            N    spfileRAC.ora => +DATA/RAC/PARAMETERFILE/spfile.268.961984543
ASMCMD> exit

Restart the cluster.

[oracle@o1 dbs]$ srvctl stop database -d RAC

[oracle@o1 dbs]$ srvctl start database -d RAC

Check for new parameter file.
    
[oracle@o1 dbs]$ . oraenv
ORACLE_SID = [+ASM1] ? RAC1

SQL> show parameter spfile

NAME         TYPE VALUE
------------ ----------- ------------------------------

spfile            string  +DATA/rac/spfilerac.ora

2 comments:

  1. Well explained. Thanks for sharing. It helped me to create spfile from pfile.

    ReplyDelete
  2. Thanks for the step by step procedure. I was struggling to recreate spfile from pfile in RAC. It resolved my issue.

    ReplyDelete

Leave a Reply...