To restore the database from HOST_A to HOST_B with a recovery catalog:
- Copy the
init.ora
file for HOST_A to HOST_B using an O/S utility. - Connect to the HOST_B target instance and HOST_A recovery catalog. For example, enter:
% rman target sys/change_on_install@host_b rman/rman@rcat
- Start the instance without mounting it:
startup nomount;
- Restore and mount the control file. Execute a run command with the following sub-commands:
- Because there may be multiple threads of redo, use change-based recovery. Obtain the SCN for recovery termination by finding the lowest SCN among the most recent archived redo logs for each thread.
Start SQL*Plus and use the following query to determine the necessary SCN:SELECT min(scn) FROM (SELECT max(next_change#) scn FROM v$archived_log GROUP BY thread#);
- Execute a run command with the following sub-commands:
- Set the SCN for recovery termination using the value obtained from the previous step.
- Allocate at least one channel.
- Restore the database.
- Recover the database.
- Open the database with the RESETLOGS option.
run { set until scn = 500; # use appropriate SCN for incomplete recovery allocate channel ch1 type 'sbt_tape'; restore database; recover database; sql "ALTER DATABASE OPEN RESETLOGS"; }
To restore from HOST_A to HOST_B without a recovery catalog:
- Copy the
init.ora
file for HOST_A to HOST_B using an O/S utility. - Use an O/S utility to make an image copy of the HOST_A control file and transfer it to HOST_B using an O/S utility.
- Connect to the HOST_B target instance with the nocatalog option. For example, enter:
% rman target sys/change_on_install@host_b nocatalog
- Mount the database:
startup mount;
- Because there may be multiple threads of redo, use change-based recovery. Obtain the SCN for recovery termination by finding the lowest SCN among the most recent archived redo logs for each thread.
Start SQL*Plus and use the following query to determine the necessary SCN:SELECT min(scn) FROM (SELECT max(next_change#) scn FROM v$archived_log GROUP BY thread#);
- Execute a run command with the following sub-commands:
- Set the SCN for recovery termination using the value obtained from the previous step.
- Allocate at least one channel.
- Restore the database.
- Recover the database.
- Open the database with the RESETLOGS option.
run { set until scn 500; # use appropriate SCN for incomplete recovery allocate channel ch1 type 'sbt_tape'; alter database mount; restore database; recover database; sql "ALTER DATABASE OPEN RESETLOGS"; }
No comments:
Post a Comment