How to retrieve lost control file


How to retrieve lost control file

ORA-00210: cannot open the specified control file

To simulate the situation of a lost control file or disk failure, I deleted a control file while the Oracle Database was running.

SQL> alter database datafile '/u02/app/oracle/oradata/mynewdb/users01.dbf' resize 512M;
Database altered. 

SQL> ! rm -f /u02/app/oracle/oradata/mynewdb/control01.ctl

Then I shutdown the database.

SQL> shutdown immediate;
Database closed.
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u02/app/oracle/oradata/mynewdb/control01.ctl'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3

Then I start the database up.

SQL> startup
ORA-01081: cannot start already-running ORACLE - shut it down first
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: '/u02/app/oracle/oradata/mynewdb/control01.ctl'
ORA-27041: unable to open file
Linux Error: 2: No such file or directory
Additional information: 3

The database does not start as it was closed only but instance may still be running as shown by the following output:

$ ps -eaf | grep pmon
oracle    1942     1  0 01:55 ?        00:00:00 ora_pmon_mynewdb
oracle    3215  3201  0 03:12 pts/5    00:00:00 grep pmon

Resolution
~~~~~~~~~~~~~

First of all get the location(s) and filename for control file.

SQL> show parameter control_file;
NAME                         TYPE   VALUE
------------------------------------ ----------- ---------------------------
control_file_record_keep_time      integer      7
control_files                      string /u02/app/oracle/oradata/mynewd
                                     b/control01.ctl, /u03/app/orac
                                     le/fast_recovery_area/mynewdb/
                                     control02.ctl

Note: You can also use init parameter file or alert log file for this purpose.

Now to solve the problem all you have to make sure is that a valid control file is placed at all the locations with their correct file name. We assume that you have multiplexed your control file (as shown above) and lost the control file from one of the location.

Now do the following steps:

1. Shutdown the database.

SQL> shutdown abort;
ORACLE instance shut down.

2. Copy the control file from one valid location to the missing location(s).

SQL> ! cp /u03/app/oracle/fast_recovery_area/mynewdb/control02.ctl /u02/app/oracle/oradata/mynewdb/control01.ctl

3. Now Start the database.

SQL> startup

ORACLE instance started.
...................
....................
Database mounted.
Database opened.
SQL>
SQL> select name, open_mode from v$database;

NAME    OPEN_MODE
--------- --------------------
MYNEWDB   READ WRITE

Note: Your data file resize operation was successful and if you see, it do not lost in the restoration operation.

Comments

Back To Top

Popular posts from this blog

How to save video from Internet Explorer

error 18 at 0 depth lookup: self signed certificate

How to check fragmentation in MySQL tables