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:
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
TOclause is not used. The default location is platform-specific, for example,?/dbs/spfile.oraon 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.
-
-
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.
-
If the database instance is started at the time of the loss of the server parameter file, then connect to the target database.
-
Start RMAN and do one of the following:
-
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 DBIDto 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
RUNcommand to restore the server parameter file.
Depending on the situation, you may need to execute multiple commands in theRUNcommand. Note the following considerations:
-
If restoring from tape, then use
ALLOCATE CHANNELto allocate an SBT channel manually. If restoring from disk, then RMAN uses the default disk channel.
-
If restoring from tape, then use
-
Shut down the database instance and restart it without mounting.
-
If the autobackups were not produced with the default format (
%F), then use theSET CONTROLFILE AUTOBACKUP FOR DEVICE TYPEcommand to specify the format in effect when the autobackup was performed.
-
If the most recent autobackup was not created today, then use
SET UNTILto specify the date from which to start the search.
-
If RMAN is not connected to a recovery catalog, then you need to use
SET DBIDto set the DBID for the target database.
-
If you want to restore the server parameter file to a nondefault location, then specify the
TOclause orTO PFILEclause on theRESTORE SPFILEcommand.
-
If you know that RMAN never produces more than n autobackups each day, then you can set the
RESTORE SPFILE FROM AUTOBACKUP ... MAXSEQparameter to n to reduce the search time.MAXSEQis set to 255 by default, andRESTOREcounts backward fromMAXSEQto 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 setMAXDAYS 1on theRESTOREcommand.
The following example illustrates aRUNcommand 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 lineSPFILE=new_location, wherenew_locationis 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.orawhich 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;
-
Restart the database instance with the restored file.
No comments:
Post a Comment