Explanation/Reference:
Explanation:
Recovering the Database After a Disaster
The procedure for disaster recovery is similar to the procedure for recovering the database with a backup control file in NOCATALOG mode. If you are restoring the database to a new host, then you should also review the considerations described in "Restoring a Database on a New Host".
This scenario assumes that the Linux server on which your database was running has been damaged beyond repair. Fortunately, you backed up the database to Oracle Secure Backup and have the tapes available. The scenario assumes the following:
Oracle Database is already installed on the new host.

You are restoring the database to a new Linux host with the same directory structure as the old host.

You have one tape drive containing backups of all the data files and archived redo logs through log

1124, and autobackups of the control file and server parameter file.
You do not use a recovery catalog with the database.

To recover the database on the new host:
1. If possible, restore or re-create all relevant network files such as tnsnames.ora and listener.ora and a password file.
2. Start RMAN and connect to the target database instance.
At this stage, no initialization parameter file exists. If you have set ORACLE_SID and ORACLE_HOME, then you can use operating system authentication to connect as SYSDBA. For example, start RMAN as follows:
% rman
RMAN> CONNECT TARGET
/
3. Specify the DBID for the target database with the SET DBID command, as described in "Restoring the Server Parameter File".
For example, enter the following command:
SET DBID 676549873;
4. Run the STARTUP NOMOUNT command.
When the server parameter file is not available, RMAN attempts to start the instance with a dummy server parameter file.
5. Allocate a channel to the media manager and then restore the server parameter file from autobackup.
For example, enter the following command to restore the server parameter file from Oracle Secure Backup:
RUN
{
ALLOCATE CHANNEL c1 DEVICE TYPE sbt;
RESTORE SPFILE FROM AUTOBACKUP;
}
6. Restart the instance with the restored server parameter file.
STARTUP FORCE NOMOUNT;
7. Write a command file to perform the restore and recovery operation, and then execute the command file.
The command file should do the following:
a. Allocate a channel to the media manager.
b. Restore a control file autobackup (see "Performing Recovery with a Backup Control File and No Recovery Catalog").
c. Mount the restored control file.
d. Catalog any backups not recorded in the repository with the CATALOG command.
e. Restore the data files to their original locations. If volume names have changed, then run SET NEWNAME commands before the restore operation and perform a switch after the restore operation to update the control file with the new locations for the data files, as shown in the following example.
f. Recover the data files. RMAN stops recovery when it reaches the log sequence number specified.
RMAN> RUN
{
# Manually allocate a channel to the media manager
ALLOCATE CHANNEL t1 DEVICE TYPE sbt;
# Restore autobackup of the control file. This example assumes that you have
# accepted the default format for the autobackup name.
RESTORE CONTROLFILE FROM AUTOBACKUP;
# The set until command is used in case the database
# structure has changed in the most recent backups, and you want to
# recover to that point in time. In this way RMAN restores the database
# to the same structure that the database had at the specified time.
ALTER DATABASE MOUNT;
SET UNTIL SEQUENCE 1124 THREAD 1;
RESTORE DATABASE;
RECOVER DATABASE;
}
The following example of the RUN command shows the same scenario except with new file names for the restored data files:
RMAN> RUN
{
# If you must restore the files to new locations,
# use SET NEWNAME commands:
SET NEWNAME FOR DATAFILE 1 TO '/dev/vgd_1_0/rlvt5_500M_1';
SET NEWNAME FOR DATAFILE 2 TO '/dev/vgd_1_0/rlvt5_500M_2';
SET NEWNAME FOR DATAFILE 3 TO '/dev/vgd_1_0/rlvt5_500M_3';
ALLOCATE CHANNEL t1 DEVICE TYPE sbt;
RESTORE CONTROLFILE FROM AUTOBACKUP;
ALTER DATABASE MOUNT;
SET UNTIL SEQUENCE 124 THREAD 1;
RESTORE DATABASE;
SWITCH DATAFILE ALL; # Update control file with new location of data files.
RECOVER DATABASE;
}
8. If recovery was successful, then open the database and reset the online logs:
ALTER DATABASE OPEN RESETLOGS;