Sunday Nov 25, 2012

How to recreate spfile on Exadata?

  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]

About

Bandari Huang | Exadata Solution Consultant Phone: +86-21-2302-3838 | Mobile: +86-156-9213-8783 Oracle Exadata & Strategic Solutions Consulting, Great China

Search

Categories
Archives
« November 2012 »
SunMonTueWedThuFriSat
    
1
2
3
4
5
6
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
26
27
28
29
30
 
       
Today