RelationalDBDesign RelationalDBDesign

Incomplete Recovery   «Prev  Next»
Lesson 3 Investigating different types of incomplete recovery
Objective List different types of incomplete recovery.

Investigating Different Types of Incomplete Recovery

There are four types of incomplete recovery:
  1. time-based recovery,
  2. cancel-based recovery,
  3. recovery using a backup control file,
  4. and change-based recovery.

You can decide which method to use based on the status of your database.

TIME-BASED A specific point in time is known
  1. Bad data was committed to the database; or
  2. Important data was dropped. To minimize the data loss and recovery time, the DBA should be notified immediately after the user error occurs.
  3. You know the approximate time when a non-mirrored online redo log becomes corrupt.
  1. Multiplex online redo logs
  2. Test programs, security, and procedures
CANCEL-BASED A specific archived redo log file is known
  1. Your current redo log file or group is lost or corrupt and you cannot use it for recovery.
  2. You lost archived logs needed for recovery.
  1. Mirror online redo logs
  2. Make frequent backups and duplex the archived log files.
CHANGE-BASED A specific SCN is known
  1. You are recovering a database in a distributed environment.
BACKUP CONTROL FILE Complete Loss of the control file
  1. You lose all the current control files. You cannot recreate the control file, but you have the backup of the older control file.
  2. There is a need to restore the database to a certain point in time with a structure different from the current one.
  1. Mirror the control file onto a different disk
  2. Keep a current text version of the control file by issuing the ALTER DATABASE BACKUP CONTROLFILE TO TRACE; statement.

One of us once worked in a place where a system administrator saw some *.log files in several directories and decided that since they were just log files, they could be deleted:
$ rm *.log

The log files that were removed were all of our online redo log files for the database. As a result, we had to perform an incomplete database recovery to get our database back online. Incomplete database recovery means that you cannot recover all committed transactions. Incomplete means that you do not apply all redo to restore to the point of the last committed transaction that occurred in your database. In other words, you are restoring and recovering to a point in time in the past. For this reason, incomplete database recovery is also called database point-in-time recovery (DBPITR). Usually you perform incomplete database recovery because of one of the following reasons:
  1. You do not have all the redo required to perform a complete recovery. You are missing either archived redo log files or online redo log files (current or unarchived) that are required for complete recovery. This situation could arise because the required redo files are damaged or missing.
  2. You purposely want to roll the database back to a point in time. For example, you would do this in the event somebody accidentally truncated a table and you intentionally wanted to roll the database back to just before the truncate table command was issued.

Change-based recovery is often applied when you recover a database in a distributed environment. Since a distributed database is beyond the scope of this course, this recovery method is not taught in detail in this module.
The next lesson describes recover command syntax and the steps to perform an incomplete database recovery.