Recovering the Database
The procedure for performing complete recovery on the database differs depending on whether the control file is available.
To recover the database when the control file is intact:
- Start RMAN and connect to the target database and, optionally, the recovery catalog database. For example, enter:
% rman target / catalog rman/rman@rcat
- If the database is open, shut it down, then mount it:
shutdown immediate; startup mount;
- After allocating channels, restore the database and recover it. This example skips the read-only TEMP tablespace:
run { allocate channel ch1 type disk; restore database; recover database skip tablespace temp; }
- Examine the output to see if recovery was successful. After RMAN restores the necessary datafiles, look for
RMAN-08055
in the output:
RMAN-08024: channel ch1: restore complete RMAN-03023: executing command: partial resync RMAN-08003: starting partial resync of recovery catalog RMAN-08005: partial resync complete RMAN-03022: compiling command: recover RMAN-03022: compiling command: recover(1) RMAN-03022: compiling command: recover(2) RMAN-03022: compiling command: recover(3) RMAN-03023: executing command: recover(3) RMAN-08054: starting media recovery RMAN-08515: archivelog filename=/oracle/arc_dest/arcr_1_40.arc thread=1 sequence=40 RMAN-08515: archivelog filename=/oracle/arc_dest/arcr_1_41.arc thread=1 sequence=41 RMAN-08055: media recovery complete RMAN-03022: compiling command: recover(4) RMAN-08031: released channel: ch1
To recover the database using a backup control file:
When you perform a restore operation using a backup control file and you use a recovery catalog, RMAN automatically adjusts the control file to reflect the structure of the restored backup.
- Start RMAN and connect to the target database and, optionally, the recovery catalog database. If you use a recovery catalog, RMAN updates the control file. For example, enter:
% rman target / catalog rman/rman@rcat
- Start the instance without mounting the database:
startup nomount;
- After allocating one or more channels, do the following:
- Use the restore controlfile command to restore the control file to all locations specified in the CONTROL_FILES initialization parameter.
- Mount the database.
- Restore and recover the database.
- Open the database with the RESETLOGS option.
run { allocate channel ch1 type 'sbt_tape'; restore controlfile; alter database mount; restore database; recover database; sql "ALTER DATABASE OPEN RESETLOGS"; }
- Reset the database:
reset database;
- Immediately back up the database. Because the database is a new incarnation, the pre-RESETLOGS backups are not usable. For example, enter:
run { allocate channel ch1 type 'sbt_tape'; backup database; }
No comments:
Post a Comment