Recovery with Archiving  «Prev  Next»

Lesson 3 Listing the Different Methods of Recovery
Objective Explain how database state, affected files, and recovery scope determine the appropriate recovery method.

Oracle AI Database 26ai Recovery Methods and Database States

The recovery method you choose in Oracle AI Database 26ai depends on what failed, which files or objects are affected, and the state to which you must recover. Database state determines which operations can proceed and which parts of the database remain available while recovery takes place.

For example, recovering the datafiles of an entire multitenant container database, or CDB, requires the database to be mounted rather than open. An eligible application datafile can instead be taken offline and recovered while unaffected data remains accessible. Recovering individual corrupt blocks has different requirements again.

These choices extend the distinction established in the previous lesson: an instance crash with intact files normally triggers automatic instance recovery, physical file loss requires media-recovery planning, and unwanted committed changes may require logical repair or point-in-time recovery.

Separate the Recovery Target, Scope, and State

Recovery terminology describes several different decisions. Keeping them separate makes it easier to select a procedure and understand its consequences.

For instance, complete recovery of an offline application datafile can occur in an open database. The endpoint is current, the scope is one file, and the database remains open. These descriptions complement one another; they are not competing names for the same decision.

How Database State Affects Recovery

An instance must be running to perform recovery work. A database described as "closed for recovery" is commonly mounted, with its control file available, even though ordinary applications cannot access its data.

Database State and Recovery Operations
State or condition Typical recovery work Availability and restrictions
NOMOUNT Restore a lost control file before mounting the database. The instance is running, but no control file is mounted. Datafile media recovery cannot proceed in this state.
MOUNT Restore and recover whole-CDB datafiles, perform whole-CDB point-in-time recovery, or perform whole-CDB Flashback Database. The control file is mounted. The database is not open for normal application access.
OPEN, affected files offline Restore and recover eligible tablespaces or datafiles. Unaffected data can remain available. The files being restored and recovered remain unavailable until successfully recovered and brought online.
OPEN, affected file online Perform eligible block media recovery. The entire datafile need not be taken offline. Access to affected blocks can be interrupted during repair.
CDB open, target PDB closed Perform supported PDB point-in-time recovery or Flashback PDB procedures. Other PDBs can remain operational. Requirements depend on the operation, undo configuration, and recovery target.

A requirement for continuous availability does not make every recovery operation possible in OPEN state. Critical files supporting the database itself require different treatment from an ordinary application datafile. Use the applicable mounted recovery procedure for SYSTEM or active-undo file recovery, with the affected container and scope identified first.

Also distinguish database state from file state. An open database can contain offline datafiles. Conversely, mounting a database does not establish that all files are healthy or that all required backups are available. State describes the operating context, not the success of recovery.

In a multitenant environment, the word MOUNTED also appears as a PDB open-mode value. A PDB reported as MOUNTED is closed within its CDB; this does not mean the whole CDB is only mounted. The CDB may be open with several other PDBs serving applications. Always identify whether a reported state belongs to the instance, the CDB, or a particular PDB before choosing an operation.

Four Practical Recovery Scenarios

The following scenarios illustrate common choices for datafile recovery. They are useful examples rather than an exhaustive list of Oracle recovery methods.

1. Recover While the Database Is Mounted

Mounted recovery is appropriate when the recovery scope requires the database to remain closed to applications. Examples include whole-CDB datafile recovery and recovery involving critical files that cannot be isolated while the relevant database remains operational.

With a usable control file mounted, RMAN can identify files and backup records. The DBA restores the required backups, applies recovery information, and opens the database using the procedure appropriate to the recovery performed.

If the server parameter file, or SPFILE, is also lost, startup configuration must first be restored or supplied through an appropriate bootstrap procedure. Restoring an SPFILE restores initialization settings; it does not apply redo or recover application transactions. Likewise, restoring a control file provides essential database metadata but does not by itself complete datafile recovery.

The business impact may be substantial, but availability preferences cannot override file dependencies. If the database cannot safely open without the affected files, it must remain in the required recovery state until those dependencies are resolved.

2. Recover an Eligible File When the Database Is Already Open

Suppose an application datafile becomes unavailable while the database is running. If the affected file can be isolated without preventing the rest of the database from operating, take that file or its tablespace offline before restoring it.

The conceptual sequence is to isolate the affected files, restore appropriate backups, recover the files, and return them online. Application functions that depend on those files remain unavailable, even though unrelated functions may continue.

This is complete datafile recovery performed within an open database. It does not mean Oracle permits unrestricted replacement of files that applications are actively using.

3. Open Unaffected Data Before Finishing File Recovery

A failure may leave the instance stopped or prevent the database from opening because an application datafile is missing. Where the damaged files are eligible for offline recovery, the DBA can mount the database, identify and offline those files, and open the unaffected database contents if all remaining opening requirements are satisfied.

Recovery of the offline files can then proceed while unaffected work resumes. The same restore-and-recover principle applies as in the previous scenario; the difference is the starting state and the preparation required before opening.

This approach is conditional. It cannot bypass missing critical files, unresolved consistency requirements, or other startup errors. Oracle's complete database recovery guide describes procedures for the relevant recovery scopes.

4. Reconstruct a Datafile That Has No Backup

A newly added datafile might be lost before its first scheduled backup. In a limited recovery scenario, Oracle can re-create an eligible file and rebuild its contents by applying the required redo from the time of its creation.

This requires control-file metadata identifying the file and all necessary redo since its creation, including any required surviving online redo. Missing redo or changes that cannot be reconstructed because of NOLOGGING can prevent success. The ALTER DATABASE CREATE DATAFILE mechanism cannot reconstruct SYSTEM datafiles.

This advanced exception does not justify omitting backups. It can require a much longer redo history than ordinary recovery from a recent file backup. A later module examines the procedure; Oracle documents its prerequisites under re-creating datafiles when backups are unavailable.

Automatic Recovery After an Instance Failure

If the current datafiles, control files, and required online redo remain intact, an abrupt shutdown normally requires automatic instance recovery as the database opens. Oracle rolls forward recorded changes and uses undo to remove uncommitted work. Transaction rollback can continue after opening.

Both ARCHIVELOG and NOARCHIVELOG databases support instance recovery. This process does not normally require restoring a backup, manually applying archived redo, or opening with RESETLOGS.

After a clean shutdown with intact files, no instance recovery is needed. However, clean shutdown does not mean every transaction was committed: SHUTDOWN IMMEDIATE rolls back uncommitted transactions, while normal shutdown waits for sessions to disconnect. Physical file loss after either shutdown still requires separate diagnosis.

Complete Recovery and Point-in-Time Recovery

Complete media recovery applies the information necessary to bring restored files to the current required consistency point. Archived redo, applicable incremental backups, and surviving online redo may contribute. Merely applying the last log available in a directory does not establish that recovery is complete.

Point-in-time recovery deliberately returns data to an earlier consistent state. A target can identify the point before an unwanted transaction or an endpoint that remains recoverable when later required information is unavailable. Suitable backups and recovery information must support that target.

Whole-database point-in-time recovery affects the CDB and its PDBs. PDB point-in-time recovery limits the scope to an eligible PDB. Tablespace point-in-time recovery, or TSPITR, returns a supported set of tablespaces to an earlier state using an auxiliary recovery environment. Object relationships and recovery prerequisites must be considered before choosing a narrower scope.

Opening rules depend on the operation. Ordinary complete recovery using the current control file normally opens without RESETLOGS. DBPITR and recovery using a backup control file require RESETLOGS. PDB PITR reopens the affected PDB with RESETLOGS; do not apply that rule as a whole-CDB operation after TSPITR or table recovery.

Block, Table, and Flashback Recovery

Block Media Recovery

When a small number of blocks are physically corrupt, block media recovery can avoid restoring an entire datafile. RMAN repairs eligible blocks while the rest of the file remains available, although access to the affected blocks can be interrupted.

This method has specific prerequisites, including ARCHIVELOG mode and a current control file. Backup-based block recovery uses suitable full or level 0 backups and required archived redo; level 1 incremental backups cannot replace those recovery inputs. It is not a solution for a completely missing datafile.

Recovering Tables from RMAN Backups

RMAN table recovery can retrieve eligible tables or partitions at an earlier point without rewinding the entire production database. RMAN creates an auxiliary database, restores and recovers the required supporting files there, and creates a Data Pump export containing the recovered objects.

The objects can then be imported into the target, with supported remapping where needed. The target must be open read/write and use ARCHIVELOG mode. Backups, auxiliary space, and object restrictions still matter. See Oracle's table and partition recovery guidance.

Flashback and Recovery Scope

Flashback Query can inspect historical data, Flashback Table can rewind eligible tables using undo, and Flashback Drop can retrieve eligible objects remaining in the recycle bin. These operations address logical errors while the relevant database or PDB is open.

Flashback Database uses available flashback history and redo to rewind existing datafiles. Whole-CDB Flashback requires mounting the CDB. For a supported local-undo Flashback PDB operation, the CDB can remain open while the target PDB is closed; other PDBs can remain available.

Flashback requires appropriate prior preparation and reachable history. It cannot replace physical backups after datafile loss. A normal restore point names a target; a guaranteed restore point provides stronger flashback retention subject to its requirements. Neither is a backup. Oracle's Flashback and point-in-time recovery guide explains the differences.

Make Recovery Information Accessible

During media recovery, required archived redo must be accessible for Oracle to read. RMAN can restore archived logs from backup as recovery proceeds, so the DBA need not manually stage every log before starting the operation.

Backups on tape or other SBT storage still require working media-management access and sufficient disk space for restored logs. Confirm that required credentials and encryption keys are available as applicable. A recovery catalog helps locate backups through metadata, but it does not contain the physical backup contents.

A missing log in one location may exist in another destination or backup. An applicable incremental backup may also advance datafiles past changes that would otherwise require redo. If the selected recovery path still has an unresolved gap, however, the desired endpoint cannot be reached.

Preserve surviving current control files and online redo when appropriate. Restoring every database-related file indiscriminately can discard information needed to recover the affected datafiles.

Check the Current State Before Choosing a Procedure

Use an appropriately privileged administrative session. The following read-only query identifies the instance state:

SELECT instance_name, status
FROM v$instance;

For the ordinary startup states, STARTED corresponds to NOMOUNT, MOUNTED identifies a mounted database, and OPEN identifies an open database. After mounting, inspect database mode:

SELECT name, open_mode, log_mode
FROM v$database;

In a CDB, use a suitably privileged connection to the root to inspect PDB states, subject to container visibility:

SELECT con_id, name, open_mode
FROM v$pdbs
ORDER BY con_id;

Combine these results with file diagnostics and the alert log. An OPEN result does not prove that all PDBs, tablespaces, or application functions are available. Conversely, a MOUNTED result alone does not explain why the database has not opened.

Backup Choices Determine Recovery Options

Backup terminology describes several independent properties. Whole versus partial identifies scope; full versus incremental describes the datafile backup approach; backup sets versus image copies identifies the storage format.

An ordinary full datafile backup is not necessarily a whole-database backup and is not recorded as an incremental level 0 parent. Level 0 establishes the incremental baseline; level 1 captures changes relative to the applicable earlier backup. RMAN can also apply incrementals to datafile image copies.

RMAN does not always scan or copy every block. Applicable block-skipping optimizations affect backup work, and block change tracking can reduce scanning for eligible incremental backups. RMAN physical backup creation is separate from Data Pump export, even though the table-recovery workflow described above uses Data Pump to transfer recovered objects.

Backup consistency is another separate property. A consistent whole-database backup taken after a clean shutdown provides a consistent starting point, but reaching a later recovery target still requires the necessary recovery information. An online backup is normally inconsistent because the database changes during the backup. That does not mean the backup is corrupt: applying the required recovery information makes the restored files consistent at the selected endpoint.

ARCHIVELOG enables online backups and broader media-recovery options. In NOARCHIVELOG, the normal response to media loss is restoration of a consistent whole-database backup, with later work lost. Online redo remains essential for instance recovery but is not ordinary RMAN backup content.

During a recovery exercise, verify the intended scope and endpoint as well as whether commands completed. A database that opens successfully may still contain an intentionally offline tablespace or a closed PDB. Check the recovered objects and their application behavior before declaring the service restored. This connects the technical recovery procedure with the availability requirement that motivated it.

Choose the recovery target and affected scope first, then establish the required database, PDB, and file states. Confirm that the available backups and redo support the chosen procedure before changing those states. The next lesson describes the complete recovery operation in greater detail.


SEMrush Software 3 SEMrush Banner 3