在我们恢复的时候,发现中间缺失归档,大部分dba觉得从缺失的归档開始以后的归档都无法进行恢复。可是我们从很规的方式,改动数据文件相应的信息是能够跳过该缺失的归档,而且利用后面的归档进行恢复的。
SYS@orcl11g>recover datafile 6;ORA-00279: change 2054392 generated at 10/28/2014 23:20:14 needed for thread 1ORA-00289: suggestion : /opt/oracle/flash_recovery_area/ORCL11G/archivelog/2014_10_28/o1_mf_1_150_b50rqvq8_.arcORA-00280: change 2054392 for thread 1 is in sequence #150Specify log: {这里我们发现相应的归档文件已经丢失。无法进行恢复 这里我们通过bbed仅仅须要改动两个地方就可以跳过该归档。使用下一个归档进行恢复:=suggested | filename | AUTO | CANCEL}ORA-00326: log begins at change 2055246, need earlier change 2054392ORA-00334: archived log: '/opt/oracle/flash_recovery_area/ORCL11G/archivelog/2014_10_28/o1_mf_1_150_b50rqvq8_.arc'
BBED> p kcvfhckpstruct kcvfhckp, 36 bytes @484 struct kcvcpscn, 8 bytes @484 ub4 kscnbas @484 0x001f58f8 ub2 kscnwrp @488 0x0000 ub4 kcvcptim @492 0x3363df2e ub2 kcvcpthr @496 0x0001 union u, 12 bytes @500 struct kcvcprba, 12 bytes @500 ub4 kcrbaseq @500 0x00000095 ub4 kcrbabno @504 0x00000002 ub2 kcrbabof @508 0x0010 ub1 kcvcpetb[0] @512 0x02 ub1 kcvcpetb[1] @513 0x00 ub1 kcvcpetb[2] @514 0x00 ub1 kcvcpetb[3] @515 0x00 ub1 kcvcpetb[4] @516 0x00 ub1 kcvcpetb[5] @517 0x00 ub1 kcvcpetb[6] @518 0x00 ub1 kcvcpetb[7] @519 0x00BBED> modify /x 96 offset 500Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) yFile: /opt/oracle/oradata/orcl11g/zbdba01.dbf (6)Block: 1 Offsets: 500 to 1011 Dba:0x01800001------------------------------------------------------------------------96000000 02000000 10000000 02000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 0d000d00 0d000100 00000000 0000000000000000 02008001 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000<32 bytes per line>BBED> sum applyCheck value for File 6, Block 1:current = 0x6ce1, required = 0x6ce1BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/orcl11g/zbdba01.dbfBLOCK = 1DBVERIFY - Verification completeTotal Blocks Examined : 1Total Blocks Processed (Data) : 0Total Blocks Failing (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing (Index): 0Total Blocks Empty : 0Total Blocks Marked Corrupt : 0Total Blocks Influx : 0Message 531 not found; product=RDBMS; facility=BBEDBBED> show all FILE# 6 BLOCK# 1 OFFSET 500 DBA 0x01800001 (25165825 6,1) FILENAME /opt/oracle/oradata/orcl11g/zbdba01.dbf BIFILE bifile.bbd LISTFILE filelist.txt BLOCKSIZE 8192 MODE Edit EDIT Unrecoverable IBASE Dec OBASE Dec WIDTH 80 COUNT 512 LOGFILE log.bbd SPOOL NoBBED> modify /x 1f5c4e offset 484File: /opt/oracle/oradata/orcl11g/zbdba01.dbf (6)Block: 1 Offsets: 484 to 995 Dba:0x01800001------------------------------------------------------------------------1f5c4e00 00000000 2edf6333 01000000 96000000 02000000 10000000 0200000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 000000000d000d00 0d000100 00000000 00000000 00000000 02008001 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000<32 bytes per line>BBED> sum applyCheck value for File 6, Block 1:current = 0x6857, required = 0x6857BBED> verifyDBVERIFY - Verification startingFILE = /opt/oracle/oradata/orcl11g/zbdba01.dbfBLOCK = 1DBVERIFY - Verification completeTotal Blocks Examined : 1Total Blocks Processed (Data) : 0Total Blocks Failing (Data) : 0Total Blocks Processed (Index): 0Total Blocks Failing (Index): 0Total Blocks Empty : 0Total Blocks Marked Corrupt : 0Total Blocks Influx : 0Message 531 not found; product=RDBMS; facility=BBED再次进行恢复:
SYS@orcl11g>SYS@orcl11g>SYS@orcl11g>recover datafile 6;Media recovery complete.SYS@orcl11g>SYS@orcl11g>SYS@orcl11g>SYS@orcl11g>SYS@orcl11g>alter database datafile 6 online;Database altered.在生产环境不到万不得已。请勿效仿