Example: Restoring and Recovering an Entire Database having Real-time Redo
This example assumes that the protected database were configured to use real-time redo transport.
To restore and recover all the data files in a protected database:
-
Ensure that the prerequisites described in “Prerequisites for Restoring and Recovering Data from Recovery Appliance” are met.
-
Use RMAN to connect to the protected database as
TARGETand the Recovery Appliance catalog asCATALOG.See Also: “Connecting to the Protected Database and Recovery Appliance Using CLI”
-
Determine the SCN to which the protected database must be recovered by querying the RC_DATABASE view. This SCN is the highest SCN at the time the database crashed.
SELECT final_change# FROM rc_database WHERE name='MY_DB' -
Restore the control file from a backup created before the SCN at which the recovery will be done. As per our example we should find the backup of control file with SCN lower than 23098.
-
Restore and recover all the data files using the following command:
This example assumes that the control file is available. If the control file is lost, then you need to first recover the control file before performing the steps listed here.
STARTUP NOMOUNT; RUN { SET UNTIL SCN 23098; RESTORE DATABASE; RECOVER DATABASE; ALTER DATABASE OPEN RESETLOGS; }Note: The
UNTIL SCNclause is required. Unless a specific SCN value is chosen, the log containing the partial redo is not applied by recovery.