The Archiving mode of the RMAN experiment involves backup, normal shutdown, loss of control file recovery

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.