Before restoring the control file, you must know the dbid of the target database. As a DBA, you must back up the dbid of the database when taking over the database!
1) backup control file
RMAN> list backup of controlfile;
2) Test Data
hr@ORCL> create table t (name varchar2(20));Table created.hr@ORCL> insert into t values('think');1 row created.hr@ORCL> commit;Commit complete.
3) simulate the environment
sys@ORCL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.sys@ORCL> host rm -rf /u01/app/oracle/oradata/ORCL/controlfile/*sys@ORCL> startup ORACLE instance started.Total System Global Area 419430400 bytesFixed Size 1219760 bytesVariable Size 150995792 bytesDatabase Buffers 264241152 bytesRedo Buffers 2973696 bytesORA-00205: error in identifying control file, check alert log for more info
Because the control file is lost, the Mount state cannot be started.
4) Fix Control Files
In nocatalog, the backup information and environment configuration of RMAN are in the control file, and the control file is lost. Therefore, you have not set many custom settings for RMAN in the past, including automatic backup.
RMAN> set DBID=1316499950executing command: SET DBIDRMAN> restore controlfile from '/u01/app/oracle/flash_recovery_area/ORCL/backupset/2012_08_08/o1_mf_ncnnf_TAG20120808T101321_823lt24m_.bkp';Starting restore at 08-AUG-12using target database control file instead of recovery catalogallocated channel: ORA_DISK_1channel ORA_DISK_1: sid=155 devtype=DISKchannel ORA_DISK_1: restoring control filechannel ORA_DISK_1: restore complete, elapsed time: 00:00:02output filename=/u01/app/oracle/oradata/ORCL/controlfile/o1_mf_823mrrdo_.ctloutput filename=/u01/app/oracle/flash_recovery_area/ORCL/controlfile/o1_mf_823mrrrp_.ctlFinished restore at 08-AUG-12RMAN> alter database mount;database mountedreleased channel: ORA_DISK_1
5) restore the database
Because all data files are present, you only need to re-use the redo log files generated after the backup control file
RMAN> recover database;
6) resetlogs open the database
Because the backup control file is restored, you must specify the resetlogs
RMAN> alter database open resetlogs;database openedRMAN> list incarnation of database;List of Database IncarnationsDB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time------- ------- -------- ---------------- --- ---------- ----------1 1 ORCL 1316499950 PARENT 1 30-JUN-052 2 ORCL 1316499950 PARENT 446075 15-JUL-123 3 ORCL 1316499950 CURRENT 604802 08-AUG-12
7) query data
hr@ORCL> select * from t;NAME--------------------think
OK, everything is perfect.