HOME > > Recovery

Recovery

Anup - Wednesday, April 17, 2024

Recovery

1. Type of recovery?

There are four types of recovery:

• Datafile media recovery (also called media recovery)

• Crash recovery

• Instance recovery

• Disaster recovery

2. diffrent type of Recovery

Complete Recovery

Incomplete Recovery

cancel-based recovery

point in time

change-based recovery

3. What is Complete Recovery?

Complete recovery can be done with the database OPEN unless the SYSTEM or UNDO tablespaces are damaged (this will terminate the instance).

When your database is running in no archive log mode and the entire database is restored to the point of the last whole closed backup, called Complete recovery.

When your database is running archive log mode and Only needs to restore lost files and recovers all data to the time of failure, called Complete recovery.

4. Short step for complete recovery:

Datafiles/Tablespace for restore must be offline.

Restore only lost or damaged datafiles.

Recover the datafiles using the Recover command.

Bring recovered datafiles online

5. What is Incomplete Recovery

Incomplete Recovery occurs when complete recovery is impossible or you want to lose some information that was entered by mistake.

You can say, 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 inadvertently 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.

6. What is a cancel-based recovery?

A cancel-based recovery is a user-managed incomplete recovery that is performed by specifying the UNTIL CANCEL clause with the RECOVER command. UNTIL CANCEL clause to perform recovery until the user manually cancels the recovery process. Oracle Cancel-Based Recovery is usually performed when there is a requirement to recover up to a particular archived redo log file.

If the user does not specify CANCEL then the recovery process will automatically stop when all redo has been applied to the database.

7. When cancel based requery is required

• For example consider a situation where someone dropped a table and one of the online redo logs is missing and is not archived and the table needs to be recovered. • Another case is where your backup control file does not know anything about the arhivelogs that got created after your last backup. • Another scenario can be where you have lost all logs pass a specific sequence say X (For example, you may know that you have lost all logs past sequence 1234, so you want to cancel recovery after log 1233 is applied) and you want to control which archived log terminates recovery. Or a scenario where one of the archived redo log files required for the complete recovery is corrupt or missing and the only recovery option is to recover up to the missing archived redo log file.

8. What is a point in time recovery?

A point in time recovery is a method to recover your database to any point in time since the last database backup.

We use RECOVER DATABASE UNTIL TIME statements to begin time-based recovery. The time is always specified using the following format, delimited by single quotation marks: 'YYYY-MM-DD:HH24:MI:SS'.

Example: RECOVER DATABASE UNTIL TIME '2000-12-31:12:47:30'

If a backup of the control file is being used with this incomplete recovery, then indicate this in the statement used to start recovery.

Example: RECOVER DATABASE UNTIL TIME '2000-12-31:12:47:30' USING BACKUP CONTROLFILE

In this type of recovery, apply redo logs until the last required redo log has been applied to the restored datafiles. Oracle automatically terminates the recovery when it reaches the correct time, and returns a message indicating whether recovery is successful.

9. What is change-based recovery?

Change-based recovery is a recovery technique using which a database is recovered up to a specified system change number (SCN). Using the UNTIL CHANGE clause with the RECOVER command performs a manual change-based recovery. However, RMAN uses the UNTIL SCN clause to perform a change-based recovery.

Begin change-based recovery, specifying the SCN for recovery termination. The SCN is specified as a decimal number without quotation marks. For example, to recover through SCN 10034 issue:

RECOVER DATABASE UNTIL CHANGE 10034;

Continue applying redo log files until the last required redo log file has been applied to the restored datafiles. Oracle automatically terminates the recovery when it reaches the correct SCN, and returns a message indicating whether recovery is successful.

Contact me

Get in Touch

Need to get touch with me? Please fill out the form with your enquiry.

Name
Anup Srivastav
Address
Lucknow - Utter Pradesh
Email
myindiandba@gmail.com
Message me