How to recreate spfile on Exadata?

Posted by Bandari Huang on Oracle Blogs See other posts from Oracle Blogs or by Bandari Huang
Published on Mon, 26 Nov 2012 03:35:04 +0000 Indexed on 2012/11/26 5:12 UTC
Read the original article Hit count: 505

Filed under:
  1. Copy spfile from the ASM diskgroup to local disk by using the ASMCMD command line tool.
     ASMCMD> pwd
    +DATA_DM01/EDWBASE
    ASMCMD> ls -l
    Type Redund Striped Time Sys Name
    Y CONTROLFILE/
    Y DATAFILE/
    Y ONLINELOG/
    Y PARAMETERFILE/
    Y TEMPFILE/
    N spfileedwbase.ora =>
    +DATA_DM01/EDWBASE/PARAMETERFILE/spfile.355.800017117
    ASMCMD> cp +DATA_DM01/EDWBASE/spfileedwbase.ora /home/oracle/spfileedwbase.ora.bak
  2. Copy the context from spfileedwbase.ora.bak to initedwbase.ora except garbled character.
  3. Using above initedwbase.ora, start one of the RAC instances to the mount phase. 
     SQL> startup mount pfile=/home/oracle/initedwbase.ora
  4. Ensure one of the database instances is mounted before attempting to recreate the spfile. 
    SQL> select INSTANCE_NAME,HOST_NAME,STATUS from v$instance;
    INSTANCE_NAME HOST_NAME  STATUS
    ------------- ---------  ------
    edwbase1      dm01db01   MOUNTED
  5. Create the new spfile.
    SQL> create spfile='+DATA_DM01/EDWBASE/spfileedwbase.ora' from pfile='/home/oracle/initedwbase.ora';
  6. ASMCMD will show that a new spfile has been created as the alias spfilerac2.ora is now pointing to a new spfile under the PARAMETER directory in ASM.
    ASMCMD> pwd
    +DATA_DM01/EDWBASE
    ASMCMD> ls -l
    Type Redund Striped Time Sys Name
    Y CONTROLFILE/
    Y DATAFILE/
    Y ONLINELOG/
    Y PARAMETERFILE/
    Y TEMPFILE/
    N spfilerac2.ora =>
    +DATA_DM01/EDWBASE/PARAMETERFILE/spfile.356.800013581
     
  7. 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.
    SQL> exit
    [oracle@dm01db01 ~]$ srvctl start database -d edwbase
    [oracle@dm01db01 ~]$ srvctl status database -d edwbase
    Instance edwbase1 is running on node dm01db01
    Instance edwbase2 is running on node dm01db02
  8. ASMCMD will now show a number of spfiles exist in the PARAMETERFILE directory for this database. The spfile containing the parameter preventing startups
    should be removed from ASM.
    In this case the file spfile.355.800017117 can be removed because spfile.356.800013581 is the current spfile.
    ASMCMD> pwd
    +DATA_DM01/EDWBASE
    ASMCMD> cd PARAMETERFILE
    ASMCMD> ls -l
    Type Redund Striped Time Sys Name
    PARAMETERFILE UNPROT COARSE FEB 19 08:00:00 Y spfile.355.800017117
    PARAMETERFILE UNPROT COARSE FEB 19 08:00:00 Y spfile.356.800013581
    ASMCMD> rm spfile.355.800017117
    ASMCMD> ls
    spfile.356.800013581

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

© Oracle Blogs or respective owner

Related posts about /Oracle