What is media recovery?

What is media recovery?

While Instance Recovery is the "self-healing" that happens after a simple crash, Media Recovery is the heavy-duty restoration required when your hardware actually fails.

If a disk dies, a file is accidentally deleted, or a controller malfunctions, your physical Data Files are gone. Since the "brain" (the Instance) no longer has a "body" (the Database) to talk to, you have to perform Media Recovery to bring the data back from the dead.


1. When is Media Recovery Required?

Media recovery is necessary whenever a physical integrity issue occurs. Common scenarios include:

  • A hard drive failure (lost .dbf files).

  • Accidental deletion of a datafile at the OS level.

  • Data corruption discovered by the database.

Unlike Instance Recovery, which happens automatically every time you reboot after a crash, Media Recovery is a manual process initiated by a Database Administrator (DBA).


2. The Prerequisites: Archivelog Mode

You can only perform a full Media Recovery if your database is running in ARCHIVELOG mode.

  • NOARCHIVELOG: If a disk dies, you can only restore your last full backup. Any work done between the backup and the crash is lost forever.

  • ARCHIVELOG: Oracle saves every filled Redo Log to a permanent location (Archive Logs). This allows you to "replay" every second of history since the backup was taken.


3. How Media Recovery Works: The "Time Machine"

Media Recovery follows a simple but powerful logic: Restore + Recover.

Step A: Restore (The Physical Foundation)

You go to your backups (usually via RMAN) and grab the last "good" copy of the missing file. You place this file back onto the disk. At this point, the file is old—it might be from last night or last week.

Step B: Recover (Replaying History)

This is where the magic happens. Oracle looks at the SCN (System Change Number) on the restored file and realizes it’s behind the rest of the database.

  1. Oracle fetches the Archived Redo Logs and the Online Redo Logs.

  2. It "replays" every transaction that happened to that specific file from the time of the backup until the exact moment the disk failed.

  3. The file is brought "forward in time" until it matches the SCN of the rest of the database.


4. Complete vs. Incomplete Recovery

Depending on what files you have left, you can perform two types of Media Recovery:

TypeGoalResult
Complete RecoveryRecover to the very last transaction before the failure.Zero Data Loss.
Incomplete RecoveryRecover to a specific point in time (PITR) in the past.Data lost after that specific point (used for human errors like DROP TABLE).

5. Media Recovery vs. Instance Recovery

FeatureInstance RecoveryMedia Recovery
Who starts it?Oracle (Automatically)DBA (Manually)
Tools UsedSMON processRMAN or SQL*Plus
Required FilesOnline Redo LogsBackups + Archived Redo Logs
Typical CausePower failure / SHUTDOWN ABORTDisk failure / File deletion

6. The Final Step: OPEN RESETLOGS

If you have to perform an Incomplete Recovery (going back to a point in time), you must open the database using:

ALTER DATABASE OPEN RESETLOGS;

This tells Oracle to start a new "incarnation" of the database and reset the log sequence numbers, essentially creating a new timeline.


Peer Tip: The most important command for any Oracle DBA to ensure they can survive a media failure is:

SQL> ARCHIVE LOG LIST;

If the output says "No Archive Mode," you are flying without a parachute!

Looking for servers Rental ?

Call Our Expert :


  • (call for rental enquiries)

Email us :