Incomplete Recovery   «Prev  Next»

Lesson 4Incomplete database recovery steps
ObjectiveDescribe the processes used in incomplete recovery.

Incomplete Database Recovery Steps with Archiving

Recover command

The following commands are used to perform incomplete recovery:
TYPES OF INCOMPLETE RECOVERY COMMAND SYNTAX
Time-based recovery RECOVER [AUTOMATIC] DATABASE UNTIL TIME 'YYYY-MM-DD:HH:MI:SS';
Cancel-based recovery RECOVER [AUTOMATIC] DATABASE UNTIL CANCEL;
Change-based recovery RECOVER DATABASE UNTIL CHANGE <INTEGER>;
Recovery using a backup control file RECOVER [AUTOMATIC] DATABASE UNTIL TIME 'YYYY-MM-DD:HH:MI:SS' |CANCEL|CHANGE USING BACKUP CONTROLFILE;

Alternatives to use when you perform Incomplete Recovery

There are some alternatives to use when you perform incomplete recovery. If you use Enterprise Manager media recovery options, you may add ALTER DATABASE in front of the RECOVER command. To make Oracle automatically apply redo log files during recovery, there are two methods:
  1. Enter AUTO at the recovery prompt
  2. Use the command RECOVERY AUTOMATIC

Recovery steps

Incomplete recovery is a difficult operation. Experience shows that most problems that occur in the process are caused by DBA errors. Thus, it is essential to carefully follow the recovery steps demonstrated in the View SlideShow below.
You may also preview all the steps.
As a DBA, you should also make sure the objects are recovered before you make the database available to your users. You may, for example, query the user's schema to check that the supposedly recovered objects exist. If they do not, you have to repeat the recovery process again.

The following six images describe the steps for incomplete recovery.
1) Incomplete Database Recovery 1 2) Incomplete Database Recovery 2 3) Incomplete Database Recovery 3 4) Incomplete Database Recovery 4 5) Incomplete Database Recovery 5 6) Incomplete Database Recovery 6

Program 1 Program 2 Program 3 Program 4 Program 5 Program 6
  1. Step 1: Shut down the database and perform a whole closed database backup (including control files and redo logs) before you start the incomplete recovery.
    There are two reasons for this: 1) If your incomplete recovery fails (for example, you recover past the desired point of recovery), you will not be able to apply the redo logs and control files that you have already used for the next recovery. You will need to use the backup of these files.
    2) It saves you time if your first attempt fails. If this happens, you can restore the datafiles from the new backup, rather than from a previous backup that needs to have archived logs applied. If you cannot perform a whole backup for some reason, you should at least archive the current redo logs. (By issuing the ALTER SYSTEM ARCHIVE LOG CURRENT statement) and backup the control file.
  2. Step2: Restore all datafiles (only datafiles)
    In order to take your database back in time, you need to restore all the datafiles (not from the backup made in the previous step). In an Oracle database, transaction activities can only be rolled forward to the desired time, not back to that time. If you fail to restore all the datafiles, the database will not be synchronized and cannot be opened.
  3. Step 3: Open the database in mount mode
    SVRMGR> STARTUP MOUNT PFILE=INITORCL.ORA
    
  4. Step 4: Recover the datafiles to the specified time, redo log file, or change number.
    SVRMGR >RECOVER DATABASE UNTIL TIME | CANCEL |CHANGE
    

    In this example, the datafiles are only recovered until ARC_70.ora is applied and then the recovery process is terminated.
  5. Step 5: Open the database with the RESETLOGS option
    SVRMGR>ALTER DATABASE OPEN RESETLOGS;
    
    After incomplete recovery, the datafiles have different sequence number with the control file and online redo log files. You have to open the database with the RESETLOGS option to synchronize all datafiles. During this process, if a redo log file is missing, it is automatically recreated.
  6. Step 6: Perform a whole database backup after successful incomplete recovery
    After you open the database with the RESETLOGS option, all the files are synchronized to the same number. Notice that the RESETLOGS options reset all the files to 1. It is important to perform a whole database backup after a successful incomplete recovery because this is the only valid backup if a recovery is required at a later time.

Six Steps to Incomplete Recovery
The next lesson shows how to monitor the recovery progress using the alert log.

Incomplete Database Recovery Steps

Click the link below to review your understanding of incomplete database recovery steps.
Incomplete Database Recovery Steps

Oracle RMAN Backup and Recovery