Incomplete recovery uses a backup to produce a non-current version of the database. In other words, you do not apply all of the redo records generated after the most recent backup.
You usually perform incomplete recovery of the whole database in the following situations:
- Media failure destroys some or all of the online redo logs.
- A user error causes data loss, for example, a user by mistake drops a table.
- You cannot perform complete recovery because an archived redo log is missing.
- You lose your current control file and must use a backup control file to open the database.
To perform incomplete media recovery, you must restore all datafiles from backups created prior to the time to which you want to recover and then open the database with the RESETLOGS option when recovery completes. The RESETLOGS operation creates a new incarnation of the database; in other words, a database with a new stream of log sequence numbers starting with log sequence 1.
NOTE – Start every RMAN incomplete recovery with the following commands:
$ sqlplus “/ as sysdba”
SQL> shutdown abort;
SQL> startup mount;
$ rman target /
–
-For time-based recovery, use these commands:
RMAN> restore database until time “to_date(’07/12/05 12:0:00′,’MM/DD/YY
HH24:MI:SS’)”;
RMAN> recover database until time “to_date(’07/12/05 12:0:00′,’MM/DD/YY HH24:MI:SS’)”;
media recovery complete
SQL> alter database open resetlogs;
–For SCN-based recovery, user these commands:
RMAN> restore database until scn 1000;
RMAN> recover database until scn 1000;
media recovery complete.
SQL> alter database open resetlogs;
–For change-based recovery, user these commands:
RMAN> restore database until sequence 9923; –Archived log sequence number
RMAN> recover database until sequence 9923; –Archived log sequence number
media recovery complete.
SQL> alter database open resetlogs;
Responses