跳过归档日志的完全非常规恢复(一) http://blog.chinaunix.net/uid-22948773-id-3294762.html
跳过归档日志的完全非常规恢复(二) http://blog.chinaunix.net/uid-22948773-id-3294763.html
跳过归档日志的完全非常规恢复(三) http://blog.chinaunix.net/uid-22948773-id-3294767.html
跳过归档日志的完全非常规恢复(四) http://blog.chinaunix.net/uid-22948773-id-3294770.html
跳过归档日志的完全非常规恢复(五) http://blog.chinaunix.net/uid-22948773-id-3294773.html
步骤5、探讨RECOVER需要修改的文件头信息
RESTORE 文件
- 还原数据文件
- [oracle@db2server ~]$ rman target /
- Recovery Manager: Release 11.2.0.1.0 - Production on Tue Jul 31 00:22:13 2012
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- connected to target database: HUATENG (DBID=2134565240, not open)
- RMAN> restore datafile 6;
- Starting restore at 2012-07-31 00:22:20
- using target database control file instead of recovery catalog
- allocated channel: ORA_DISK_1
- channel ORA_DISK_1: SID=17 device type=DISK
- channel ORA_DISK_1: starting datafile backup set restore
- channel ORA_DISK_1: specifying datafile(s) to restore from backup set
- channel ORA_DISK_1: restoring datafile 00006 to /u01/app/oracle/oradata/huateng/htyansp01.dbf
- channel ORA_DISK_1: reading from backup piece /u01/app/oracle/flash_recovery_area/HUATENG/backupset/2012_07_31/o1_mf_nnndf_TAG20120731T000915_81fdfg00_.bkp
- channel ORA_DISK_1: piece handle=/u01/app/oracle/flash_recovery_area/HUATENG/backupset/2012_07_31/o1_mf_nnndf_TAG20120731T000915_81fdfg00_.bkp tag=TAG20120731T000915
- channel ORA_DISK_1: restored backup piece 1
- channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
- Finished restore at 2012-07-31 00:22:23
- RMAN>
尝试进行RECOVER
- SQL> recover datafile 6;
- ORA-00279: change 849630 generated at 07/31/2012 00:09:16 needed for thread 1
- ORA-00289: suggestion : /archivelog/1_7_789791289.dbf
- ORA-00280: change 849630 for thread 1 is in sequence #7
- Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
- /archivelog/1_7_789791289.dbf
- ORA-00279: change 849781 generated at 07/31/2012 00:14:17 needed for thread 1
- ORA-00289: suggestion : /archivelog/1_8_789791289.dbf
- ORA-00280: change 849781 for thread 1 is in sequence #8
- Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
暂时先不应用归档日志序列号为8的文件。
我们采用BBED先记录此时的数据文件头的信息。
- [oracle@db2server ~]$ bbed filename=/u01/app/oracle/oradata/huateng/htyansp01.dbf
- Password:
- BBED: Release 2.0.0.0.0 - Limited Production on Tue Jul 31 00:24:44 2012
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- ************* !!! For Oracle Internal Use only !!! ***************
- BBED> p kcvfh
- struct kcvfh, 860 bytes @0
- struct kcvfhbfh, 20 bytes @0
- ub1 type_kcbh @0 0x0b
- ub1 frmt_kcbh @1 0xa2
- ub1 spare1_kcbh @2 0x00
- ub1 spare2_kcbh @3 0x00
- ub4 rdba_kcbh @4 0x01800001
- ub4 bas_kcbh @8 0x00000000
- ub2 wrp_kcbh @12 0x0000
- ub1 seq_kcbh @14 0x01
- ub1 flg_kcbh @15 0x04 (KCBHFCKV)
- ub2 chkval_kcbh @16 0xc785
- ub2 spare3_kcbh @18 0x0000
- struct kcvfhhdr, 76 bytes @20
- ub4 kccfhswv @20 0x00000000
- ub4 kccfhcvn @24 0x0b200000
- ub4 kccfhdbi @28 0x7f3ae178
- text kccfhdbn[0] @32 H
- text kccfhdbn[1] @33 U
- text kccfhdbn[2] @34 A
- text kccfhdbn[3] @35 T
- text kccfhdbn[4] @36 E
- text kccfhdbn[5] @37 N
- text kccfhdbn[6] @38 G
- text kccfhdbn[7] @39
- ub4 kccfhcsq @40 0x00000325
- ub4 kccfhfsz @44 0x00000500
- s_blkz kccfhbsz @48 0x00
- ub2 kccfhfno @52 0x0006
- ub2 kccfhtyp @54 0x0003
- ub4 kccfhacid @56 0x00000000
- ub4 kccfhcks @60 0x00000000
- text kccfhtag[0] @64
- text kccfhtag[1] @65
- text kccfhtag[2] @66
- text kccfhtag[3] @67
- text kccfhtag[4] @68
- text kccfhtag[5] @69
- text kccfhtag[6] @70
- text kccfhtag[7] @71
- text kccfhtag[8] @72
- text kccfhtag[9] @73
- text kccfhtag[10] @74
- text kccfhtag[11] @75
- text kccfhtag[12] @76
- text kccfhtag[13] @77
- text kccfhtag[14] @78
- text kccfhtag[15] @79
- text kccfhtag[16] @80
- text kccfhtag[17] @81
- text kccfhtag[18] @82
- text kccfhtag[19] @83
- text kccfhtag[20] @84
- text kccfhtag[21] @85
- text kccfhtag[22] @86
- text kccfhtag[23] @87
- text kccfhtag[24] @88
- text kccfhtag[25] @89
- text kccfhtag[26] @90
- text kccfhtag[27] @91
- text kccfhtag[28] @92
- text kccfhtag[29] @93
- text kccfhtag[30] @94
- text kccfhtag[31] @95
- ub4 kcvfhrdb @96 0x00000000
- struct kcvfhcrs, 8 bytes @100
- ub4 kscnbas @100 0x000cf590
- ub2 kscnwrp @104 0x0000
- ub4 kcvfhcrt @108 0x2f1715c8
- ub4 kcvfhrlc @112 0x2f134239
- struct kcvfhrls, 8 bytes @116
- ub4 kscnbas @116 0x000b8338
- ub2 kscnwrp @120 0x0000
- ub4 kcvfhbti @124 0x00000000
- struct kcvfhbsc, 8 bytes @128
- ub4 kscnbas @128 0x00000000
- ub2 kscnwrp @132 0x0000
- ub2 kcvfhbth @136 0x0000
- ub2 kcvfhsta @138 0x0000 (NONE)
- struct kcvfhckp, 36 bytes @484
- struct kcvcpscn, 8 bytes @484
- ub4 kscnbas @484 0x000cf775
- ub2 kscnwrp @488 0x0000
- ub4 kcvcptim @492 0x2f171759
- ub2 kcvcpthr @496 0x0001
- union u, 12 bytes @500
- struct kcvcprba, 12 bytes @500
- ub4 kcrbaseq @500 0x00000008
- ub4 kcrbabno @504 0x00000002
- ub2 kcrbabof @508 0x0000
- 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 0x00
- ub4 kcvfhcpc @140 0x00000004
- ub4 kcvfhrts @144 0x2f171995
- ub4 kcvfhccc @148 0x00000003
- struct kcvfhbcp, 36 bytes @152
- struct kcvcpscn, 8 bytes @152
- ub4 kscnbas @152 0x00000000
- ub2 kscnwrp @156 0x0000
- ub4 kcvcptim @160 0x00000000
- ub2 kcvcpthr @164 0x0000
- union u, 12 bytes @168
- struct kcvcprba, 12 bytes @168
- ub4 kcrbaseq @168 0x00000000
- ub4 kcrbabno @172 0x00000000
- ub2 kcrbabof @176 0x0000
- ub1 kcvcpetb[0] @180 0x00
- ub1 kcvcpetb[1] @181 0x00
- ub1 kcvcpetb[2] @182 0x00
- ub1 kcvcpetb[3] @183 0x00
- ub1 kcvcpetb[4] @184 0x00
- ub1 kcvcpetb[5] @185 0x00
- ub1 kcvcpetb[6] @186 0x00
- ub1 kcvcpetb[7] @187 0x00
- ub4 kcvfhbhz @312 0x00000000
- struct kcvfhxcd, 16 bytes @316
- ub4 space_kcvmxcd[0] @316 0x00000000
- ub4 space_kcvmxcd[1] @320 0x00000000
- ub4 space_kcvmxcd[2] @324 0x00000000
- ub4 space_kcvmxcd[3] @328 0x00000000
- sword kcvfhtsn @332 7
- ub2 kcvfhtln @336 0x0007
- text kcvfhtnm[0] @338 H
- text kcvfhtnm[1] @339 T
- text kcvfhtnm[2] @340 Y
- text kcvfhtnm[3] @341 A
- text kcvfhtnm[4] @342 N
- text kcvfhtnm[5] @343 S
- text kcvfhtnm[6] @344 P
- text kcvfhtnm[7] @345
- text kcvfhtnm[8] @346
- text kcvfhtnm[9] @347
- text kcvfhtnm[10] @348
- text kcvfhtnm[11] @349
- text kcvfhtnm[12] @350
- text kcvfhtnm[13] @351
- text kcvfhtnm[14] @352
- text kcvfhtnm[15] @353
- text kcvfhtnm[16] @354
- text kcvfhtnm[17] @355
- text kcvfhtnm[18] @356
- text kcvfhtnm[19] @357
- text kcvfhtnm[20] @358
- text kcvfhtnm[21] @359
- text kcvfhtnm[22] @360
- text kcvfhtnm[23] @361
- text kcvfhtnm[24] @362
- text kcvfhtnm[25] @363
- text kcvfhtnm[26] @364
- text kcvfhtnm[27] @365
- text kcvfhtnm[28] @366
- text kcvfhtnm[29] @367
- ub4 kcvfhrfn @368 0x00000006
- struct kcvfhrfs, 8 bytes @372
- ub4 kscnbas @372 0x00000000
- ub2 kscnwrp @376 0x0000
- ub4 kcvfhrft @380 0x00000000
- struct kcvfhafs, 8 bytes @384
- ub4 kscnbas @384 0x00000000
- ub2 kscnwrp @388 0x0000
- ub4 kcvfhbbc @392 0x00000000
- ub4 kcvfhncb @396 0x00000000
- ub4 kcvfhmcb @400 0x00000000
- ub4 kcvfhlcb @404 0x00000000
- ub4 kcvfhbcs @408 0x00000000
- ub2 kcvfhofb @412 0x0000
- ub2 kcvfhnfb @414 0x0000
- ub4 kcvfhprc @416 0x296a3120
- struct kcvfhprs, 8 bytes @420
- ub4 kscnbas @420 0x00000001
- ub2 kscnwrp @424 0x0000
- struct kcvfhprfs, 8 bytes @428
- ub4 kscnbas @428 0x00000000
- ub2 kscnwrp @432 0x0000
- ub4 kcvfhtrt @444 0x00000000
- BBED>
将上面打印出来的信息保存为recover_sequence7.txt
再次回到原来的recovery界面,应用归档日志序列号为8的文件。
如下:
- SQL> recover datafile 6;
- ORA-00279: change 849630 generated at 07/31/2012 00:09:16 needed for thread 1
- ORA-00289: suggestion : /archivelog/1_7_789791289.dbf
- ORA-00280: change 849630 for thread 1 is in sequence #7
- Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
- /archivelog/1_7_789791289.dbf
- ORA-00279: change 849781 generated at 07/31/2012 00:14:17 needed for thread 1
- ORA-00289: suggestion : /archivelog/1_8_789791289.dbf
- ORA-00280: change 849781 for thread 1 is in sequence #8
- Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
- /archivelog/1_8_789791289.dbf
- ORA-00279: change 849798 generated at 07/31/2012 00:14:43 needed for thread 1
- ORA-00289: suggestion : /archivelog/1_9_789791289.dbf
- ORA-00280: change 849798 for thread 1 is in sequence #9
- Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
再次用BBED查询此时的数据文件头信息,如下所示:
- [oracle@db2server ~]$ bbed filename=/u01/app/oracle/oradata/huateng/htyansp01.dbf
- Password:
- BBED: Release 2.0.0.0.0 - Limited Production on Tue Jul 31 00:29:32 2012
- Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
- ************* !!! For Oracle Internal Use only !!! ***************
- BBED> show
- FILE# 0
- BLOCK# 1
- OFFSET 0
- DBA 0x00000000 (0 0,1)
- FILENAME /u01/app/oracle/oradata/huateng/htyansp01.dbf
- BIFILE bifile.bbd
- LISTFILE
- BLOCKSIZE 8192
- MODE Browse
- EDIT Unrecoverable
- IBASE Dec
- OBASE Dec
- WIDTH 80
- COUNT 512
- LOGFILE log.bbd
- SPOOL No
- BBED> p kcvfh
- struct kcvfh, 860 bytes @0
- struct kcvfhbfh, 20 bytes @0
- ub1 type_kcbh @0 0x0b
- ub1 frmt_kcbh @1 0xa2
- ub1 spare1_kcbh @2 0x00
- ub1 spare2_kcbh @3 0x00
- ub4 rdba_kcbh @4 0x01800001
- ub4 bas_kcbh @8 0x00000000
- ub2 wrp_kcbh @12 0x0000
- ub1 seq_kcbh @14 0x01
- ub1 flg_kcbh @15 0x04 (KCBHFCKV)
- ub2 chkval_kcbh @16 0xc404
- ub2 spare3_kcbh @18 0x0000
- struct kcvfhhdr, 76 bytes @20
- ub4 kccfhswv @20 0x00000000
- ub4 kccfhcvn @24 0x0b200000
- ub4 kccfhdbi @28 0x7f3ae178
- text kccfhdbn[0] @32 H
- text kccfhdbn[1] @33 U
- text kccfhdbn[2] @34 A
- text kccfhdbn[3] @35 T
- text kccfhdbn[4] @36 E
- text kccfhdbn[5] @37 N
- text kccfhdbn[6] @38 G
- text kccfhdbn[7] @39
- ub4 kccfhcsq @40 0x00000327
- ub4 kccfhfsz @44 0x00000500
- s_blkz kccfhbsz @48 0x00
- ub2 kccfhfno @52 0x0006
- ub2 kccfhtyp @54 0x0003
- ub4 kccfhacid @56 0x00000000
- ub4 kccfhcks @60 0x00000000
- text kccfhtag[0] @64
- text kccfhtag[1] @65
- text kccfhtag[2] @66
- text kccfhtag[3] @67
- text kccfhtag[4] @68
- text kccfhtag[5] @69
- text kccfhtag[6] @70
- text kccfhtag[7] @71
- text kccfhtag[8] @72
- text kccfhtag[9] @73
- text kccfhtag[10] @74
- text kccfhtag[11] @75
- text kccfhtag[12] @76
- text kccfhtag[13] @77
- text kccfhtag[14] @78
- text kccfhtag[15] @79
- text kccfhtag[16] @80
- text kccfhtag[17] @81
- text kccfhtag[18] @82
- text kccfhtag[19] @83
- text kccfhtag[20] @84
- text kccfhtag[21] @85
- text kccfhtag[22] @86
- text kccfhtag[23] @87
- text kccfhtag[24] @88
- text kccfhtag[25] @89
- text kccfhtag[26] @90
- text kccfhtag[27] @91
- text kccfhtag[28] @92
- text kccfhtag[29] @93
- text kccfhtag[30] @94
- text kccfhtag[31] @95
- ub4 kcvfhrdb @96 0x00000000
- struct kcvfhcrs, 8 bytes @100
- ub4 kscnbas @100 0x000cf590
- ub2 kscnwrp @104 0x0000
- ub4 kcvfhcrt @108 0x2f1715c8
- ub4 kcvfhrlc @112 0x2f134239
- struct kcvfhrls, 8 bytes @116
- ub4 kscnbas @116 0x000b8338
- ub2 kscnwrp @120 0x0000
- ub4 kcvfhbti @124 0x00000000
- struct kcvfhbsc, 8 bytes @128
- ub4 kscnbas @128 0x00000000
- ub2 kscnwrp @132 0x0000
- ub2 kcvfhbth @136 0x0000
- ub2 kcvfhsta @138 0x0000 (NONE)
- struct kcvfhckp, 36 bytes @484
- struct kcvcpscn, 8 bytes @484
- ub4 kscnbas @484 0x000cf786
- ub2 kscnwrp @488 0x0000
- ub4 kcvcptim @492 0x2f171773
- ub2 kcvcpthr @496 0x0001
- union u, 12 bytes @500
- struct kcvcprba, 12 bytes @500
- ub4 kcrbaseq @500 0x00000009
- ub4 kcrbabno @504 0x00000002
- ub2 kcrbabof @508 0x0000
- 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 0x00
- ub4 kcvfhcpc @140 0x00000004
- ub4 kcvfhrts @144 0x2f171ace
- ub4 kcvfhccc @148 0x00000003
- struct kcvfhbcp, 36 bytes @152
- struct kcvcpscn, 8 bytes @152
- ub4 kscnbas @152 0x00000000
- ub2 kscnwrp @156 0x0000
- ub4 kcvcptim @160 0x00000000
- ub2 kcvcpthr @164 0x0000
- union u, 12 bytes @168
- struct kcvcprba, 12 bytes @168
- ub4 kcrbaseq @168 0x00000000
- ub4 kcrbabno @172 0x00000000
- ub2 kcrbabof @176 0x0000
- ub1 kcvcpetb[0] @180 0x00
- ub1 kcvcpetb[1] @181 0x00
- ub1 kcvcpetb[2] @182 0x00
- ub1 kcvcpetb[3] @183 0x00
- ub1 kcvcpetb[4] @184 0x00
- ub1 kcvcpetb[5] @185 0x00
- ub1 kcvcpetb[6] @186 0x00
- ub1 kcvcpetb[7] @187 0x00
- ub4 kcvfhbhz @312 0x00000000
- struct kcvfhxcd, 16 bytes @316
- ub4 space_kcvmxcd[0] @316 0x00000000
- ub4 space_kcvmxcd[1] @320 0x00000000
- ub4 space_kcvmxcd[2] @324 0x00000000
- ub4 space_kcvmxcd[3] @328 0x00000000
- sword kcvfhtsn @332 7
- ub2 kcvfhtln @336 0x0007
- text kcvfhtnm[0] @338 H
- text kcvfhtnm[1] @339 T
- text kcvfhtnm[2] @340 Y
- text kcvfhtnm[3] @341 A
- text kcvfhtnm[4] @342 N
- text kcvfhtnm[5] @343 S
- text kcvfhtnm[6] @344 P
- text kcvfhtnm[7] @345
- text kcvfhtnm[8] @346
- text kcvfhtnm[9] @347
- text kcvfhtnm[10] @348
- text kcvfhtnm[11] @349
- text kcvfhtnm[12] @350
- text kcvfhtnm[13] @351
- text kcvfhtnm[14] @352
- text kcvfhtnm[15] @353
- text kcvfhtnm[16] @354
- text kcvfhtnm[17] @355
- text kcvfhtnm[18] @356
- text kcvfhtnm[19] @357
- text kcvfhtnm[20] @358
- text kcvfhtnm[21] @359
- text kcvfhtnm[22] @360
- text kcvfhtnm[23] @361
- text kcvfhtnm[24] @362
- text kcvfhtnm[25] @363
- text kcvfhtnm[26] @364
- text kcvfhtnm[27] @365
- text kcvfhtnm[28] @366
- text kcvfhtnm[29] @367
- ub4 kcvfhrfn @368 0x00000006
- struct kcvfhrfs, 8 bytes @372
- ub4 kscnbas @372 0x00000000
- ub2 kscnwrp @376 0x0000
- ub4 kcvfhrft @380 0x00000000
- struct kcvfhafs, 8 bytes @384
- ub4 kscnbas @384 0x00000000
- ub2 kscnwrp @388 0x0000
- ub4 kcvfhbbc @392 0x00000000
- ub4 kcvfhncb @396 0x00000000
- ub4 kcvfhmcb @400 0x00000000
- ub4 kcvfhlcb @404 0x00000000
- ub4 kcvfhbcs @408 0x00000000
- ub2 kcvfhofb @412 0x0000
- ub2 kcvfhnfb @414 0x0000
- ub4 kcvfhprc @416 0x296a3120
- struct kcvfhprs, 8 bytes @420
- ub4 kscnbas @420 0x00000001
- ub2 kscnwrp @424 0x0000
- struct kcvfhprfs, 8 bytes @428
- ub4 kscnbas @428 0x00000000
- ub2 kscnwrp @432 0x0000
- ub4 kcvfhtrt @444 0x00000000
将打印出来的kcvfh结构另存为recover_sequence8.txt
阅读(2070) | 评论(0) | 转发(0) |