About Me

My photo
Bangalore, India
I am an Oracle Certified Professional working in SAP Labs. Everything written on my blog has been tested on my local environment, Please test before implementing or running in production. You can contact me at amit.rath0708@gmail.com.

Wednesday, October 24, 2012

ORA-00205: error in identifying control file

Loss of one control files or if any of the current control file is available:-

If you loss any one of the control file present in your database then you are not able to start your database you will get below mentioned error when trying to start your database :-

If database is not running and you try to start your database then loss of one controlfile will give you below error :-

ORA-00205: error in identifying control file

Below are the available actions :-

Copy the available control file to that destination where previously lost control file was available. Now open your database normally.
                                        OR
Remove the detail of the lost control file from the remaining available current controlfile and start the database normally.

If database is running then loss of one controlfile will suspend your work :-

SQL> select open_mode from v$database;
select open_mode from v$database
                      *
ERROR at line 1:
ORA-00210: cannot open the specified control file
ORA-00202: control file: +AMIT_R1/orcl/controlfile/current.260.797540569'
ORA-27041: unable to open file
SVR4 Error: 2: No such file or directory
Additional information: 3

SQL> shu abort
ORACLE instance shut down.
SQL> exit

After shutting down do one of the below mentioned actions :- 

Copy the available control file to that destination where previously lost control file was available. 
                                          OR
Remove the detail of the lost control file from the remaining available current controlfile.

Now start your database :-


SQL> startup
ORACLE instance started.

Total System Global Area 1.3700E+10 bytes
Fixed Size                  2161112 bytes
Variable Size            6878660136 bytes
Database Buffers         6811549696 bytes
Redo Buffers                7610368 bytes
Database mounted.
Database opened.

Loss of all control files

Loss of all controlfiles should never happen. We have to keep copies of all controlfiles in different locations, but there is still the possibility that we have to recover from losing all those copies. So "Prevention is better than recovery".

If we have lost all copies of current controlfile and we have a backup to recover controlfile from that , then our course of action depends on status of online log files and datafiles.

Online logs available :- 

A. If online logs are available contains redo data for recovery and datafiles are current then:-
1. Restore a backup controlfile from backup.
2. Perform complete recovery.(Specify the name of the REDO logs when asked for that)
3. Open the database with RESETLOGS option.

Note :- If online logs are available contains redo data for recovery and datafiles are not current then perform the same procedure for recovery from the loss of all controlfiles.

Online logs not available :- 

A. If online logs are not available and datafiles are current , then:-
1. Recreate the controlfile.
2. Mount the database
3. Open the database with RESETLOGS.

B. If online logs are not available and datafiles are not current then :-
1. Restore a backup controlfile.
2. Perform a Point-in-time recovery of the database.
3. Open the database with Resetlogs.

Eg :- If we loss all controlfiles then :-

When we tried to start the database we will get the following error :-

SQL> startup
ORACLE instance started.

Total System Global Area 1025298432 bytes
Fixed Size                  1341000 bytes
Variable Size             322963896 bytes
Database Buffers          696254464 bytes
Redo Buffers                4739072 bytes
ORA-00205: error in identifying control file, check alert log for more info

SQL> shu immediate;
ORA-01507: database not mounted

ORACLE instance shut down.
SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1025298432 bytes
Fixed Size                  1341000 bytes
Variable Size             322963896 bytes
Database Buffers          696254464 bytes
Redo Buffers                4739072 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[cognos@rac1 ~]$ rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Wed Oct 24 19:02:28 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to target database: ORCL (not mounted)

RMAN> restore controlfile from autobackup;

Starting restore at 24-OCT-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=23 device type=DISK

recovery area destination: +AMIT_R1
database name (or database unique name) used for search: ORCL
channel ORA_DISK_1: AUTOBACKUP +amit_r1/ORCL/AUTOBACKUP/2012_10_24/s_797530166.287.797530169 found in the recovery area
AUTOBACKUP search with format "%F" not attempted because DBID was not set
channel ORA_DISK_1: restoring control file from AUTOBACKUP +amit_r1/ORCL/AUTOBACKUP/2012_10_24/s_797530166.287.797530169
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=+AMIT_R1/orcl/controlfile/current.260.797540569
output file name=+AMIT_R1/orcl/controlfile/current.261.797540569
Finished restore at 24-OCT-12

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1


RMAN> recover database;

Starting recover at 24-OCT-12
Starting implicit crosscheck backup at 24-OCT-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=26 device type=DISK
Crosschecked 34 objects
Finished implicit crosscheck backup at 24-OCT-12

Starting implicit crosscheck copy at 24-OCT-12
using channel ORA_DISK_1
Finished implicit crosscheck copy at 24-OCT-12

searching for all files in the recovery area
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: +amit_r1/ORCL/AUTOBACKUP/2012_10_24/s_797530166.287.797530169

using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 14 is already on disk as file +AMIT_R1/orcl/onlinelog/group_2.265.790789025
archived log file name=+AMIT_R1/orcl/onlinelog/group_2.265.790789025 thread=1 sequence=14
media recovery complete, elapsed time: 00:00:01
Finished recover at 24-OCT-12

RMAN> alter database open resetlogs;

database opened

RMAN> exit

Recovery Manager complete.
[cognos@rac1 ~]$ sqlplus

SQL*Plus: Release 11.2.0.1.0 Production on Wed Oct 24 19:07:46 2012

Copyright (c) 1982, 2009, Oracle.  All rights reserved.

Enter user-name: /as sysdba

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

Restore of database completed after loss of all control files but having onlinelog files available.

I hope this article helped you.

Regards,
Amit Rath

2 comments:

  1. I have a situation here. I do not the following files control files,Online redolog and Archivelog files.
    How do I use Datafiles to restore my data(tables)

    ReplyDelete
    Replies
    1. If you don't have the above files then you have to do incomplete recovery by creating your control files manually. You may lose your soem data too, if you are fine with it then please follow below steps:-

      How to manually create a control file, please check here https://amit7oracledba.blogspot.com/2012/10/how-to-recreate-control-file-in-oracle.html

      once you create you control file, please follow below steps :-
      1. Mount your database using the control files
      2. Do a point in time recovery and open your database with resetlogs option.

      Thanks
      Amit Rath

      Delete