RESTORE CONTROLFILE USING RMAN
FIRST WE HAVE TO CONNECT SYSDBA & IN OPEN STATE
----------------------------------------------------------------------------------------------
[oracle@localhost ~]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.4.0 Production on Sat Sep 7 12:01:18 2019
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 2137886720 bytes
Fixed Size
2254952 bytes
Variable Size
503318424 bytes
Database Buffers
1627389952 bytes
Redo Buffers
4923392 bytes
Database mounted.
Database opened.
========================================================================
GIVE EXIT TO LEAVE SQL
-------------------------------------------
SQL> exit
Disconnected from Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
GIVE THIS COMMAND TO CONNECT RMAN
--------------------------------------------------------------
[oracle@localhost ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Sat Sep 7 12:01:50 2019
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: Kavin (DBID=233981902)
RMAN>
TAKE BACKUP 0F CONTROLFIES
----------------------------------------------
RMAN> backup current controlfile;
Show in folder:
/apps/oradata/sandeep/fra/SANDEEP/autobackup/2019_09_07/o1_mf_s_1018354532_gq6njfj8_.bkp
========================================================================
REMOVE CONTROLFILE FOR TESTING
------------------------------------------------------
[THIS IS FOR OUR REFERENCE ONLY]
SQL> !rm /apps/oradata/sandeep/controlfiles/control01.ctl
SQL> !rm /apps/oradata/sandeep/controlfiles/control02.ctl
========================================================================
GIVE SHUTDOWN ABORT TO DOWN THE DATABASE
----------------------------------------------------------------------------------------
SQL> shutdown abort;
WE WILL BRING THE DATABASE IN STARTUP MOUNT
-------------------------------------------------------------------------------
SQL> startup nomount pfile='initsandeep.ora';
ORACLE instance started.
NOW CONNECT TO RMAN
----------------------------------------------
[oracle@localhost ~]$ rman target /
Recovery Manager: Release 11.2.0.4.0 - Production on Sat Sep 7 12:25:50 2019
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
connected to target database: SANDEEP (not mounted)
NOW RESTORE THE CONTROLFILE & RECOVER THE DATABASE
-------------------------------------------------------------------------------------------
RMAN> set dbid=233981902
executing command: SET DBID
RMAN> run {
2> restore controlfile from '/apps/oradata/sandeep/fra/SANDEEP/autobackup/2019_09_07/o1_mf_s_1018354532_gq6njfj8_.bkp';
3> }
RMAN> alter database mount;
RMAN> recover database;
RMAN> alter database open resetlogs;
database opened
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
/apps/oradata/sandeep/controlfiles/control01.ctl
/apps/oradata/sandeep/controlfiles/control02.ctl