DETERMINE THE LOCATION OF AUTOBACKUP OF THE CONTROLFILE AND THE SPFILE

5. Determine the location of autobackup of the controlfile and the spfile:

list backup of controlfile;list backup of spfile;

In both cases, the most recent backup set listed will be to a file in the flash

recovery area. This can be overridden by configuring a format other than

the ‘%F’ shown in Step 3, but if this is done, the automatic location of the

autobackups will no longer function.

This script accomplishes the complete restore and recovery of a database,

assuming that everything was lost:

1 run{startup nomount pfile=dummy.pfile;2 set dbid=1196323546;3 restore spfile from autobackup;4 shutdown abort;5 startup nomount;6 restore controlfile from autobackup;7 alter database mount;8 restore database;

P AR T III

9 recover database;10 alter database open resetlogs;}

Taking this script line by line,

1 Start the instance, using a dummy parameter file with just one parameter: DB_NAME.2 Tell RMAN the DBID of the database on which you are working.3 Extract the spfile from the most recent autobackup, relying on defaults for its name and location.4 Abort the instance, because (having been started with a dummy pfile) it is not of any further use.5 Start the instance, using the restored spfiles.6 Extract the controlfile from the most recent autobackup.7 Mount the controlfile.8 Restore all the datafiles.9 Carry out a complete recovery by applying any incremental backups, followed by archive log files and online log files.10 Open the database, and reinitialize the online redo log files. A RESETLOGS is always required after restoring the controlfile.