履歴バックアップ制御ファイルデータベースのリカバリ

20826 ワード

oracle 10g         incarnation      /     。     log_archive_format     %r    ,  
resetlogs , incarnation , resetlogs 。


RMAN> list incarnation; List of Database Incarnations DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time ------- ------- -------- ---------------- --- ---------- ---------- 1 1 ORCL 1358813460 PARENT 1 15-AUG-09 2 2 ORCL 1358813460 PARENT 945184 09-NOV-13 3 3 ORCL 1358813460 CURRENT 2181557 29-DEC-13
select thread#,sequence#,first_change#,next_change# from v$archived_log;

     2       55        2140766     2172246

     2       56        2172246     2181556

     2        1        2181557     2203709



   THREAD#  SEQUENCE# FIRST_CHANGE# NEXT_CHANGE#

---------- ---------- ------------- ------------

     2        2        2203709     2224422

     2        3        2224422     2258307

     2        4        2258307     2258311

     1        1        2237798     2280109

     1        2        2280109     2280114

     1        3        2280114     2280116

     2        5        2280111     2280131

     1        4        2280116     2280127

SQL> select thread#,sequence#,status from v$log;



   THREAD#  SEQUENCE# STATUS

---------- ---------- ----------------

     1        3 INACTIVE

     1        4 ACTIVE

     2        5 INACTIVE

     2        6 CURRENT

以上が元の制御ファイルの情報です.V$log_も参照historyビュー.
--------------------------
RMAN> restore controlfile from '/home/oracle/c.ctl';



Starting restore at 31-DEC-13

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=17 instance=orcl2 device type=DISK



channel ORA_DISK_1: copied control file copy

output file name=+DATA/orcl/controlfile/current.260.835608817

output file name=+FRA/orcl/controlfile/current.256.835608825

Finished restore at 31-DEC-13



RMAN> list incarnation;



released channel: ORA_DISK_1



List of Database Incarnations

DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time

------- ------- -------- ---------------- --- ---------- ----------

1       1       ORCL     1358813460       PARENT  1          15-AUG-09

2       2       ORCL     1358813460       CURRENT 945184     09-NOV-13

rmanリカバリの試行
RMAN> recover database;



Starting recover at 31-DEC-13

Starting implicit crosscheck backup at 31-DEC-13

allocated channel: ORA_DISK_1

Finished implicit crosscheck backup at 31-DEC-13



Starting implicit crosscheck copy at 31-DEC-13

using channel ORA_DISK_1

Crosschecked 2 objects

Finished implicit crosscheck copy at 31-DEC-13



searching for all files in the recovery area

cataloging files...

cataloging done



List of Cataloged Files

=======================

File Name: +fra/ORCL/BACKUPSET/2013_12_31/ncnnf0_TAG20131231T092954_0.296.835608605

……

…… //       db_recovery_file_dest             

File Name: +fra/ORCL/AUTOBACKUP/2013_12_31/thread_1_seq_2.292.835607377

File Name: +fra/ORCL/ARCHIVELOG/2013_12_31/thread_1_seq_3.293.835607395

File Name: +fra/ORCL/ARCHIVELOG/2013_12_31/thread_2_seq_5.294.835607395

File Name: +fra/ORCL/ARCHIVELOG/2013_12_31/thread_1_seq_4.295.835607399



using channel ORA_DISK_1

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of recover command at 12/31/2013 09:36:12

RMAN-06094: datafile 8 must be restored  
// datafile 8 , 。
RMAN> recover database skip tablespace wayde;



Starting recover at 31-DEC-13

using channel ORA_DISK_1



Executing: alter database datafile 8 offline

starting media recovery

……

media recovery complete, elapsed time: 00:00:16

Finished recover at 31-DEC-13



RMAN> list incarnation;





List of Database Incarnations

DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time

------- ------- -------- ---------------- --- ---------- ----------

1       1       ORCL     1358813460       PARENT  1          15-AUG-09

2       2       ORCL     1358813460       PARENT  945184     09-NOV-13

3       3       ORCL     1358813460       CURRENT 2181557    29-DEC-13

結論:履歴制御ファイルでデータベースをリカバリする場合、履歴制御ファイルの後に「表領域」、「ログファイル(activeまたはcurrent状態ではない)」、「制御ファイルにはあるが実際にはない」を新たに追加すると、リカバリ時に表領域が再構築され、ログは制御ファイルに準拠します.制御ファイルをバックアップした後に手動で表領域を削除した場合、リカバリ時にデータファイルoffline(sql文)または直接RMAN>recover database skip tablespace waydeを削除します.