Oracle Incomplete Database Recovery
Oracle Incomplete Database Recovery
Incomplete recovery can mean restoring a database to a specific point in time (date and time), a specific SCN
(system change number) or sequence number (archive log). You normally restore all the datafiles and controlfile
(only required if physical structure has changed), any archived redo logs but you do not restore the redo log files
(not normally backed up).
If you lose all copies of the current logfile group perform a incomplete recovery upto the last log switch, also if
you recover tablespaces that are in a different time to other tablespaces, they must be all the same time.
Incomplete recovery is always done in mount mode and will use the controlfile, a incomplete recovery can only
be performed if you have SYSDBA privilege. Use v$log_history to obtain the archive redo logs thread and
sequence numbers if performing a sequence number recovery.
RMAN
c:\> set NLS_DATE_FORMAT=YYYY-MM-dd HH24:MI:SS
rman> run {
set until time ’2007-12-10 11:29:00’
restore database;
RMAN Recovery recover database;
alter database open resetlogs; (always used during incomplete recovery - see below)
}
Note: When doing an incomplete recovery with SQL*Plus you have no option with the date
option it must be yyyy-mm-dd hh24:mis:ss
Incomplete Database Recovery -2-
recover database until cancel (At random type cancel to stop the recovery)
SQL Recover
recover database until change 309121
Options
recover database until time ’2007-12-10 11:29:00’ (see below for options)
Resetlogs
The restlogs clause is required in most incomplete recovery to open the database. It resets the redo log sequence
for the oracle database. For recovery through a resetlogs to work, it is vital that the names generated for the
archive logs let oracle distinguish between logs produced by different incarnations. This is why you use the %r
in the parameter log_archive_format, %r is the incarnation other wise archive logs could be written over.
After a resetlogs there will be a new database incarnation number and the log switch number will be reset. In
previous version all old backups and archive logs would have been useless but not any more in Oracle 10g.
Anytime you use the open resetlogs command, the incarnation of the database changes and a new incarnation
begins. The previous incarnation is called ancestor incarnation and the latest is called current incarnation. to
recover using previous incarnations you
1. Obtain the incarnation key that was current at the time you want to recover the database to
3. reset the current incarnation to the incarnation that was current at the point in time that you want to recover
to
5. restore and recover the database until the point in time or SCN