To recover the database on the new host:
- Ensure that the prerequisites described in Prerequisites of Disaster Recovery are met.
- If possible, restore or re-create all relevant network files such as
tnsnames.ora
andlistener.ora
and a password file. - Start RMAN and connect to the target database instance.
At this stage, no initialization parameter file exists. If you have setORACLE_SID
andORACLE_HOME
, then you can use operating system authentication to connect asSYSDBA
orSYSBACKUP
.
See Also:"Making Database Connections with RMAN" - 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;
- 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. - 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; }
- Restart the instance with the restored server parameter file.
STARTUP FORCE NOMOUNT;
- Write a command file to perform the restore and recovery operation, and then execute the command file. The command file must do the following:
- Allocate a channel to the media manager.
- Restore a control file autobackup (see "Performing Recovery with a Backup Control File and No Recovery Catalog").
- Mount the restored control file.
- Catalog any backups not recorded in the repository with the
CATALOG
command. - 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. - 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; }
No hay comentarios:
Publicar un comentario