Latest Updates

Post Top Ad

18 June, 2013

Restoring the Server Parameter File

If you lose the server parameter file, then RMAN can restore it to its default location or to a location of your choice. Unlike the loss of the control file, the loss of the server parameter file does not cause the instance to immediately stop. The instance may continue operating, although you will have to shut it down and restart it after restoring the server parameter file.
Note the following considerations when restoring the server parameter file:
  • If the instance is already started with the server parameter file, then you cannot overwrite the existing server parameter file.
  • When the instance is started with a client-side initialization parameter file, RMAN restores the server parameter file to the default location if the TO clause is not used. The default location is platform-specific, for example, ?/dbs/spfile.ora on Linux.
  • A recovery catalog simplifies the recovery procedure because you can avoid the step of having to record and remember the DBID. This procedure assumes that you are not using a recovery catalog.
To restore the server parameter file from autobackup:
  1. Start RMAN and do one of the following:
    • If the database instance is started at the time of the loss of the server parameter file, then connect to the target database.
  2. If the database instance is not started when the server parameter file is lost, and if you are not using a recovery catalog, then run SET DBID to set the DBID of the target database. See "Determining the DBID of the Database" for details on determining your DBID.
    Shut down the database instance and restart it without mounting.
    When the server parameter file is not available, RMAN starts the instance with a dummy parameter file. For example, enter the following command:
    STARTUP FORCE NOMOUNT;
    
    Execute a RUN command to restore the server parameter file.
    Depending on the situation, you may need to execute multiple commands in the RUN command. Note the following considerations:
    • If restoring from tape, then use ALLOCATE CHANNEL to allocate an SBT channel manually. If restoring from disk, then RMAN uses the default disk channel.
  3. If the autobackups were not produced with the default format (%F), then use the SET CONTROLFILE AUTOBACKUP FOR DEVICE TYPE command to specify the format in effect when the autobackup was performed.
  4. If the most recent autobackup was not created today, then use SET UNTIL to specify the date from which to start the search.
  5. If RMAN is not connected to a recovery catalog, then you need to use SET DBID to set the DBID for the target database.
  6. If you want to restore the server parameter file to a nondefault location, then specify the TO clause or TO PFILE clause on the RESTORE SPFILE command.
  7. If you know that RMAN never produces more than n autobackups each day, then you can set the RESTORE SPFILE FROM AUTOBACKUP ... MAXSEQ parameter to n to reduce the search time. MAXSEQ is set to 255 by default, and RESTORE counts backward from MAXSEQ to find the last backup of the day. To terminate the restore operation if you do not find the autobackup in the current day (or specified day), then you can set MAXDAYS 1 on the RESTORE command.
    The following example illustrates a RUN command that restores a server parameter file from an autobackup on tape:
    RUN 
    {
      ALLOCATE CHANNEL c1 DEVICE TYPE sbt PARMS ...;
      SET UNTIL TIME 'SYSDATE-7';
      SET CONTROLFILE AUTOBACKUP FORMAT 
        FOR DEVICE TYPE sbt TO '/disk1/control_files/autobackup_%F';
      SET DBID 123456789;
      RESTORE SPFILE
        TO '/tmp/spfileTEMP.ora'
        FROM AUTOBACKUP MAXDAYS 10;
    }
    
    Restart the database instance with the restored file.
    If restarting with a server parameter file in a nondefault location, then create a new initialization parameter file with the line SPFILE=new_location, where new_location is the path name of the restored server parameter file. Then, restart the instance with the client-side initialization parameter file.
    For example, create a file /tmp/init.ora which contains the single line:
    SPFILE=/tmp/spfileTEMP.ora
    
    You can use the following RMAN command to restart the instance with the restored server parameter file:
    STARTUP FORCE PFILE=/tmp/init.ora;
    

No comments:

Post Top Ad

Your Ad Spot

Pages