Database Reference
In-Depth Information
When performing an incomplete database recovery with RMAN, you must have your database in mount mode.
RMAN needs the database in mount mode to be able to read and write to the control file. Also, with an incomplete
database recovery, any SYSTEM tablespace data files are always recovered. Oracle will not allow your database to be
open while restoring the SYSTEM tablespace data file(s).
after incomplete database recovery is performed, you are required to open your database with the
ALTER DATABASE OPEN RESETLOGS command.
Note
Depending on the scenario, you can use RMAN to perform a variety of incomplete recovery methods. The next
section discusses how to determine what type of incomplete recovery to perform.
Determining the Type of Incomplete Recovery
Time-based restore and recovery is commonly used when you know the approximate date and time to which you
want to recover your database. For instance, you may know approximately the time you want to stop the recovery
process, but not a particular SCN.
Log sequence-based and cancel-based recovery work well in situations in which you have missing or damaged
log files. In such scenarios, you can recover only up to your last good archived redo log file.
SCN-based recovery works well if you can pinpoint the SCN at which you want to stop the recovery process. You
can retrieve SCN information from views such as V$LOG and V$LOG_HISTORY . You can also use tools such as LogMiner
to retrieve the SCN of a particular SQL statement.
Restore point recoveries work only if you have established restore points. In these situations, you restore and
recover up to the SCN associated with the specified restore point.
TSPITR is used in situations in which you need to restore and recover just a few tablespaces. You can use RMAN
to automate many of the tasks associated with this type of incomplete recovery.
Performing Time-Based Recovery
To restore and recover your database back to a point in time in the past, you can use either the UNTIL TIME clause of the
RESTORE and RECOVER commands or the SET UNTIL TIME clause within a run{} block. RMAN will restore and recover
the database up to, but not including, the specified time. In other words, RMAN will restore any transactions committed
prior to the time specified. RMAN automatically stops the recovery process when it reaches the time you specified.
The default date format that RMAN expects is YYYY-MM-DD:HH24:MI:SS . However, I recommend using the
TO_DATE function and specifying a format mask. This eliminates ambiguities with different national date formats and
having to set the OS NLS_DATE_FORMAT variable. The following example specifies a time when issuing the restore and
recover commands:
$ rman target /
RMAN> startup mount;
RMAN> restore database until time
"to_date('15-jan-2015 12:20:00', 'dd-mon-rrrr hh24:mi:ss')";
RMAN> recover database until time
"to_date('15-jan-2015 12:20:00', 'dd-mon-rrrr hh24:mi:ss')";
RMAN> alter database open resetlogs;
If everything goes well, you should see output such as this:
Statement processed
 
 
Search WWH ::




Custom Search