if you lose your server parameter file (SPFILE), 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 your SPFILE does not cause your instance to immediately stop. Your instance may continue operating, although you will have to shut it down and restart it after restoring the SPFILE.
Note the following when restoring the SPFILE:
- 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 SPFILE to the default SPFILE location if the TO clause is not used. The default location is platform-specific.
- Restoring the SPFILE is one situation in which a recovery catalog can simplify your recovery procedure, because you can avoid the step of having to record and remember your DBID. This procedure assumes that you are not using a recovery catalog.
Restore server parameter file if database is up:
If the database is up at the time of the loss of the SPFILE.
RMAN TARGET /
If the database is not up when the SPFILE is lost, and you are not using a recovery catalog, then you must set the DBID of the target database.
Shut down the instance and restart it without mounting. When the SPFILE is not available, RMAN starts the instance with a dummy parameter file. For example:
RMAN> STARTUP FORCE NOMOUNT;
Restore SPFILE from AUTOBACKUP
Restore the server parameter file. If restoring to the default location:
RMAN> RESTORE SPFILE FROM AUTOBACKUP;
If restoring to a nondefault location, then you could run commands as in the following example:
RMAN> RESTORE SPFILE TO '/tmp/spfileTEMP.ora' FROM AUTOBACKUP;
Restart the instance with the restored file. If restarting with a server parameter file in a nondefault location, then create a new client-side initialization parameter file with the single 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:
Then use this RMAN command, to restart the instance based on the restored SPFILE:
RMAN> STARTUP FORCE PFILE=/tmp/init.ora; # startup with /tmp/spfileTEMP.ora
Restore SPFILE from Control File Autobackup
If you have configured control file autobackups, the SPFILE is backed up with the control file whenever an autobackup is taken.
If you want to restore the SPFILE from the autobackup, you must first set the DBID for your database, and then use the RESTORE SPFILE FROM AUTOBACKUP command.
RMAN>SET DBID 320066378;
SET CONTROLFILE AUTOBACKUP FORMAT
FOR DEVICE TYPE DISK TO'autobackup_format';
RESTORE SPFILE FROM AUTOBACKUP;
Restore SPFILE as a PFILE
You can also restore the server parameter file as a client-side initialization parameter file. The filename you specify should be on a file system accessible from the host where the RMAN client is running. This file need not be accessible directly from the host running the instance.
RMAN> RESTORE SPFILE TO PFILE '/tmp/initTEMP.ora';
To restart the instance using the client-side PFILE if RMAN is running on the same client machine:
RMAN> STARTUP FORCE PFILE='/tmp/initTEMP.ora';