Wednesday, 16 March 2016

SCENARIO – LOSS OF ALL CONTROLFILES (NO CATALOG)



SQL> archive log list;
Database log mode            Archive Mode
Automatic archival             Enabled
Archive destination            USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     7
Next log sequence to archive   9
Current log sequence         9

SQL> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/rman/control01.ctl

Now, Simulate the Scenario :- I will manually remove the Controlfile from the path (DB is still running)

$ rm /u01/app/oracle/oradata/rman/control01.ctl                ---------> //Control01.ctl  removed


SQL> shut abort
ORACLE instance shut down.
SQL> startup
ORACLE instance started.

Total System Global Area  313860096 bytes
Fixed Size                       1336232 bytes
Variable Size                 197135448 bytes
Database Buffers          109051904 bytes
Redo Buffers                  6336512 bytes

ORA-00205: error in identifying control file, check alert log for more info 

You will see Error Like this, when you start your database.

Solution :


SQL> !rman target /

Recovery Manager: Release 11.2.0.1.0 - Production on Wed Mar 16 09:36:31 2016

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

connected to target database: RMAN (not mounted)

RMAN> set DBID=1792754794

executing command: SET DBID


RMAN> restore controlfile from autobackup;

Starting restore at 16-MAR-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK

recovery area destination: /u01/app/oracle/flash_recovery_area
database name (or database unique name) used for search: RMAN
channel ORA_DISK_1: AUTOBACKUP /u01/app/oracle/flash_recovery_area/RMAN/autobackup/2016_03_15/o1_mf_s_906581146_cgj7g35w_.bkp found in the recovery area
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20160316
channel ORA_DISK_1: looking for AUTOBACKUP on day: 20160315
channel ORA_DISK_1: restoring control file from AUTOBACKUP /u01/app/oracle/flash_recovery_area/RMAN/autobackup/2016_03_15/o1_mf_s_906581146_cgj7g35w_.bkp
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=/u01/app/oracle/oradata/rman/control01.ctl
Finished restore at 16-MAR-16

RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1


RMAN> recover database;

Starting recover at 16-MAR-16
Starting implicit crosscheck backup at 16-MAR-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=20 device type=DISK
Crosschecked 70 objects
Finished implicit crosscheck backup at 16-MAR-16

Starting implicit crosscheck copy at 16-MAR-16
using channel ORA_DISK_1
Finished implicit crosscheck copy at 16-MAR-16

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

List of Cataloged Files
=======================
File Name: /u01/app/oracle/flash_recovery_area/RMAN/autobackup/2016_03_15/o1_mf_s_906581146_cgj7g35w_.bkp
File Name: /u01/app/oracle/flash_recovery_area/RMAN/autobackup/2016_03_14/o1_mf_s_906491611_cgfj04yt_.bkp
File Name: /u01/app/oracle/flash_recovery_area/RMAN/autobackup/2016_03_14/o1_mf_s_906494727_cgfms61s_.bkp
File Name: /u01/app/oracle/flash_recovery_area/RMAN/autobackup/2016_03_14/o1_mf_s_906508077_cgg02pqn_.bkp
File Name: /u01/app/oracle/flash_recovery_area/RMAN/autobackup/2016_03_12/o1_mf_s_906332538_cg8no3dp_.bkp
File Name: /u01/app/oracle/flash_recovery_area/RMAN/archivelog/2016_03_15/o1_mf_1_8_cgjg8h43_.arc

using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 8 is already on disk as file /u01/app/oracle/flash_recovery_area/RMAN/archivelog/2016_03_15/o1_mf_1_8_cgjg8h43_.arc
archived log for thread 1 with sequence 9 is already on disk as file /u01/app/oracle/oradata/rman/redo03.log
archived log file name=/u01/app/oracle/flash_recovery_area/RMAN/archivelog/2016_03_15/o1_mf_1_8_cgjg8h43_.arc thread=1 sequence=8
archived log file name=/u01/app/oracle/oradata/rman/redo03.log thread=1 sequence=9
media recovery complete, elapsed time: 00:00:15
Finished recover at 16-MAR-16

RMAN> exit


Recovery Manager complete.

SQL> alter database open resetlogs;

Database altered.

SQL>

Note:  Since this is Incomplete Recovery  You need to open DB with Resetlogs always.
           You must take a Full Database Backup after issuing ResetLogs.  J





No comments:

Post a Comment