Tuesday, October 16, 2012

Recovering From A Lost Control File [ID 1014504.6]


Recovering From A Lost Control File [ID 1014504.6]

 

 Problem Description:
===============

This is the recovery scenario in which a control file has been lost or damaged to a point that Oracle cannot recognize it anymore. Trying to start up the database will result in an ORA-00205 ("error in identifying control file '%s'") and an operating system level Oracle error such as ORA-07360 ("sfifi: stat error, unable to obtain information about file.") in Oracle7 or ORA-27037 (unable to obtain file status) for Oracle8.

This entry contains the solution for this problem.

Solution Description:
===============

The solution depends on whether you have lost one of the copies of the control file in a mirrored configuration or all copies of the current control file (regardless of mirroring).

 I. ONE OF THE MIRRORED COPIES OF THE CONTROL FILE IS LOST
----------------------------------------------------------------------------------------------
In this case, one of the other copies of the control file should be used to bring the database up.

1. If the instance is still up, do a shutdown abort.

2. Use a good copy of the control file to copy onto the location of the lost one.  If you are having hardware problems with the current location of the lost control file, such as disk or controller failures, choose another  location for copying the file and then edit the "init.ora" file for this instance (or "config.ora" file in an ifile configuration) ccordingly. Edit the CONTROL_FILES parameter to reflect the current location of the control files after you have done the copy.

3. Start up the database.

II. ALL CURRENT COPIES OF THE CONTROL FILE ARE LOST
-----------------------------------------------------------------------------------
An important factor in this scenario is the existence of a backup trace of the control file generated with the ALTER DATABASE BACKUP CONTROLFILE TO TRACE command:

 - If you do have such a trace file and it reflects the current structure of the database in terms of datafiles and log files, you can edit it and run it as a SQL script to recreate the control file(s), as described in the Reference to Note:1012929.6.

- If you do not have the controlfile and are using RMAN review Note.372996.1 Using RMAN to Restore and Recover a Database When the Repository and Spfile/Init.ora Files Are Also Lost

- If you have neither the trace file nor a backup of the control file, you will have to issue the CREATE CONTROLFILE statement manually, as described in the Oracle Server SQL Reference Manual.  You may have to resort to operating system facilities (such as the "find" command in Unix) to make sure that your  CREATE CONTROLFILE statement does include ALL the existing datafiles and redo  log files in the database.  Here are the steps:

  1. Take a full backup of the database, including all datafiles and redo log files.

  2. Connect / as sysdba or as sys user and do a STARTUP NOMOUNT.

  3. Issue the CREATE CONTROLFILE statement.

               Example:
CREATE CONTROLFILE REUSE DATABASE "P716" NORESETLOGS NOARCHIVELOG
               MAXLOGFILES 50
               MAXLOGMEMBERS 3
               MAXDATAFILES 300
               MAXINSTANCES 8
               MAXLOGHISTORY 500
               LOGFILE
                               GROUP 1 '/u01/oracle/7.1.6/dbs/log1p716.dbf'  SIZE 1M,
                               GROUP 2 '/u01/oracle/7.1.6/dbs/log2p716.dbf'  SIZE 1M,
                               GROUP 3 '/u01/oracle/7.1.6/dbs/log3p716.dbf'  SIZE 1M
               DATAFILE
                               '/u01/oracle/7.1.6/dbs/systp716.dbf' SIZE 40M,
                               '/u01/oracle/7.1.6/dbs/tempp716.dbf' SIZE 1M,
                               '/u01/oracle/7.1.6/dbs/toolp716.dbf' SIZE 15M ;

  4. Perform media recovery on the database.

               RECOVER DATABASE

  5. Open the database.

              ALTER DATABASE OPEN;

  6. At the first opportunity, shut the database down (normal or immediate) and take a full cold backup.

References:
===========
Note:735106.1  HOW TO RECREATE THE CONTROL FILE
Note.403883.1   How To Restore Controlfile From A Backupset Without A Catalog Or Autobackup

 

 

Search Words:

=============

 

ORA-205 ORA-7360 ORA-27037

 

No comments:

Post a Comment