When every current control-file copy is unusable, start by rebuilding the information Oracle needs to mount and recover the database. A physical backup on disk is useful only when the required identity, settings, backup locations, and access material can also be recovered.
Oracle DBA Lesson 32 Part 3 — Recover When the Control File Is Unavailable
What each starting resource provides
| Resource | Purpose |
|---|---|
| Recorded DBID | Identifies the database whose backup control file is being restored in this no-catalog example. It does not prove physical isolation. |
| Reviewed text parameter file (PFILE) | Supplies instance startup settings, including the intended control-file locations. |
| Server parameter file (SPFILE) backup, if needed | Recovers saved settings. Restore them to an explicit new text file for review before using them. |
| Exact control-file autobackup handle | Identifies the saved disk piece containing the control file, without relying on a missing local inventory. |
| Restored control file | Supplies registered file names and RMAN backup records as of its backup. |
| Backups, required redo, and encryption access | Supply the material needed for the chosen data recovery path. |
At NOMOUNT, Oracle has read the startup settings, allocated the SGA, and started the background processes. The SGA is shared memory. The background processes are separate from that area. The database is not mounted. At MOUNT, Oracle reads the physical control files on disk to associate the instance with the database and to locate its registered data files and online redo logs. Application access remains closed. See instance startup and mounting.
Startup settings and the control file perform different jobs. Restoring one does not automatically restore the other. RESTORE DATABASE also does not include control-file or SPFILE restoration.
Conditions for control-file recovery
Use ARCHIVELOG mode on a same-identity recovery copy. This is not a new-identity clone. Retain the correct Oracle home, the externally recorded DBID, verified startup information, an accessible exact disk autobackup handle, all selected data-file backups, and the required redo, including surviving online redo when complete recovery needs it. If backups are encrypted, separately verify the necessary keystore or backup-password access.
All current control-file copies are unusable and no recovery catalog is connected. If a current multiplexed copy survives, investigate the documented current-copy repair path first. Restoring an older backup control file may be unnecessary.
Independently verify every physical storage destination and service route, including control, data, and redo files, startup files, recovery and archive locations, and any auxiliary or temp paths. Resolve mounts and links to their actual storage. Review restored settings before restarting. Old paths and shipping settings can still reference the source.
Use SYSDBA for the SQL*Plus startup, mount, and open examples, and an appropriate common SYSDBA or SYSBACKUP target connection for RMAN. The database root is the target for this whole-CDB procedure.
Start from reviewed settings
Use SQL*Plus and an explicitly reviewed PFILE:
STARTUP NOMOUNT PFILE='<REVIEWED_PFILE>';
SHOW PARAMETER control_files
Review the text file beforehand, including the intended database name, the multitenant and release requirements, the memory settings, all control-file destinations, and the other applicable storage and service settings. There is no universally safe minimal PFILE to paste for every database.
If the original SPFILE is lost, RMAN can restore its saved settings separately. With the no-catalog target started from reviewed temporary settings and the correct DBID set:
SET DBID <RECORDED_DBID>;
RUN {
SET CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK
TO '<RECORDED_AUTOBACKUP_FORMAT>';
RESTORE SPFILE TO PFILE '<NEW_TEXT_PARAMETER_FILE>'
FROM AUTOBACKUP;
}
Use a new, explicit destination on the RMAN client host and an accessible disk autobackup that actually includes the SPFILE. This separate no-catalog SPFILE example uses the documented autobackup search. Supply its recorded nondefault format only when that format is needed, and retain %F in the format. Set an appropriate reviewed search date or window if the required autobackup is older than the default search. Do not invent a format, and do not treat an unsuccessful default search as proof that no backup exists. Preserve the original saved piece. Review and adapt the recovered text settings to the isolated environment before any restart. Do not restore into the default active configuration blindly. Restart with the reviewed file. A running instance does not reread changed text settings automatically. See SPFILE and backup control-file recovery.
Restore the control file, then mount
From RMAN, connected to that same NOMOUNT instance without a recovery catalog:
SET DBID <RECORDED_DBID>;
RESTORE CONTROLFILE
FROM '<EXACT_CONTROLFILE_AUTOBACKUP_HANDLE>';
ALTER DATABASE MOUNT;
REPORT SCHEMA;
LIST BACKUP SUMMARY;
The no-catalog NOMOUNT explicit-handle path requires the recorded DBID. The handle selects the saved piece. With no TO clause, RMAN restores physical control files to all configured CONTROL_FILES locations. Confirm those locations before the first restore. The source backup is retained. See SET DBID and RESTORE.
If the handle is unknown, FROM AUTOBACKUP is a separate discovery path. Retain the actual format and location, the identity, and the relevant search-window information rather than assuming defaults. Recovery-area discovery has its own options. The exact-handle disk example avoids those search assumptions. Tape requires appropriately configured channels and media-manager access.
After mounting, inspect the actual database identity, every registered data, redo, and control path, and the restored RMAN channel settings. REPORT SCHEMA shows the registered data-file inventory. LIST BACKUP SUMMARY shows the recorded backups. A matching DBID is identity evidence, not an isolation pass. If any path maps to the source or to an unexpected storage target, stop before restoring data files. Where relocation is required, adapt it through an explicitly reviewed SET NEWNAME and SWITCH procedure.
Repair missing backup records
Suppose the restored control file contains the record for piece A, but a later piece B survives outside the recovery area. The restored repository may not know about B. Compare the recorded backups with the externally retained backup log and with the actual verified media.
Only when a needed, trusted disk piece is absent from the repository:
CATALOG BACKUPPIECE '<EXACT_DATABASE_BACKUP_PIECE>';
LIST BACKUP SUMMARY;
RESTORE DATABASE PREVIEW SUMMARY;
Cataloging adds metadata about an existing disk piece to the repository. It neither moves that piece nor restores its contents into data files. The target must be mounted or open. Cataloging checks the header and is not proof that every saved block is readable. Catalog the relevant verified disk pieces and other required material using the correct object form. BACKUPPIECE is not the form to use for SBT tape media. See CATALOG.
When an appropriate fast recovery area is used, RMAN can automatically catalog disk backups there after a control file is restored. Do not infer that every backup in every location is discovered. A recovery catalog is a separate repository. The CATALOG command registers existing material.
Match a preview for the chosen scope and target with the complete required backup and redo chain. Verify actual accessibility, encryption access, and saved-material validity separately. An older control file may also omit later structural changes or log members. Investigate those gaps against the documented recovery procedure. One catalog command does not repair every missing record.
Recover and use the required opening method
Once the destination map and the selected material are verified, restore the data files that need replacement. If the data files survived, they do not automatically require replacement solely because a control file was lost. Recovery is required after mounting a restored backup control file even if no data files were restored.
For this complete-recovery case, all required redo must remain available. Use RMAN's applicable recovery sequence and inspect its complete result:
RECOVER DATABASE;
Missing required redo, or an unresolved recovery error, is a stop condition. Find and register a required surviving log where that is appropriate, or separately evaluate a supported recovery target. Do not silently introduce an earlier target, and do not use an opening option to conceal a gap. The next part addresses deliberately chosen point-in-time recovery. See RECOVER.
Only after successful recovery with the restored backup control file, use SQL*Plus at the same root:
ALTER DATABASE OPEN RESETLOGS;
This backup-control-file recovery path requires RESETLOGS and establishes a new database incarnation. The incarnation identifies a distinct stream of redo history. RESETLOGS alone does not mean the intended result was point-in-time recovery. Complete recovery can preserve the required committed work when those changes survive. The opening decision follows the recovery method and the successful result. See RESETLOGS and database incarnations.
Check the required PDB modes, and open an application PDB only if its actual state requires it. Verify the service and session identity, the expected committed markers, and the required application operation, as in Part 02. Record the new incarnation and take a fresh backup. Preserve previous backups and incarnation records. Old backups are not automatically invalidated by the new incarnation.
No comments:
Post a Comment