二恢复(模拟8、9、10号归档丢失)
1归档11的第一个重做记录rba地址 以及 low scn
REDO RECORD - Thread:1 RBA: 0x00000b.00000002.0010 LEN: 0x01ec VLD: 0x0d
SCN: 0x0000.a5ae7f87 SUBSCN: 3 12/14/2012 22:44:37
Low scn: 0x0000.a5ae7f81 (2779676545) 12/14/2012 22:44:21
Next scn: 0x0000.a5ae7f8c (2779676556) 12/14/2012 22:44:45
2 第一次恢复过程如下(由于丢失8到10号归档,所以数据文件11头部scn只能推进到7号归档的next scn处)
RMAN> restore tablespace jiujian1;
Starting restore at 16-DEC-12
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=210 devtype=DISK
channel ORA_DISK_1: starting datafile backupset restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
restoring datafile 00011 to /Oracle/test/jiujian1.dbf
channel ORA_DISK_1: reading from backup piece /oracle/app/db1/dbs/0hnssesq_1_1
channel ORA_DISK_1: restored backup piece 1
piece handle=/oracle/app/db1/dbs/0hnssesq_1_1 tag=TAG20121214T221345
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 16-DEC-12
SQL> recover tablespace jiujian1;
ORA-00279: change 2779674784 generated at 12/14/2012 22:13:47 needed for thread
1
ORA-00289: suggestion : /oracle/archive/1_6_801995401.dbf
ORA-00280: change 2779674784 for thread 1 is in sequence #6
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA-00279: change 2779676487 generated at 12/14/2012 22:42:00 needed for thread
1
ORA-00289: suggestion : /oracle/archive/1_7_801995401.dbf
ORA-00280: change 2779676487 for thread 1 is in sequence #7
ORA-00278: log file '/oracle/archive/1_6_801995401.dbf' no longer needed for
this recovery
ORA-00279: change 2779676511 generated at 12/14/2012 22:42:54 needed for thread
1
ORA-00289: suggestion : /oracle/archive/1_8_801995401.dbf
ORA-00280: change 2779676511 for thread 1 is in sequence #8
ORA-00278: log file '/oracle/archive/1_7_801995401.dbf' no longer needed for
this recovery
ORA-00308: cannot open archived log '/oracle/archive/1_8_801995401.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 3
------------------------由于缺失归档恢复到此处时退出---------------------------------------------------------
SQL> select file#,checkpoint_change# from v$datafile_header;
FILE# CHECKPOINT_CHANGE#
---------- ------------------
1 2779722454
2 2779722454
3 2779722454
4 2779722454
5 2779722454
6 2779722454
7 2779722454
8 2779722454
9 2779722454
10 2779722454
11 2779676511
3 通过bbed 调整数据文件11头部的rba值以及scn值
RBA 调整为RBA: 0x00000b.00000002.0010
Scn 调整为 Low scn: 0x0000.a5ae7f81
[oracle@oracle ~]$ bbed parfile=bbed.para
Password: blockedit
BBED: Release 2.0.0.0.0 - Limited Production on Sun Dec 16 20:10:04 2012
Copyright (c) 1982, 2005, Oracle. All rights reserved.
************* !!! For Oracle Internal Use only !!! ***************
BBED> set dba 11,1
DBA 0x02c00001 (46137345 11,1)
BBED> show
FILE# 11
BLOCK# 1
OFFSET 0
DBA 0x02c00001 (46137345 11,1)
FILENAME /oracle/test/jiujian1.dbf
BIFILE bifile.bbd
LISTFILE /oracle/filelist
BLOCKSIZE 8192
MODE Edit
EDIT Unrecoverable
IBASE Dec
OBASE Dec
WIDTH 80
COUNT 512
LOGFILE log.bbd
SPOOL No
BBED> p kcvfhckp
struct kcvfhckp, 36 bytes @484
struct kcvcpscn, 8 bytes @484
ub4 kscnbas @484 0xa5ae7f5f
ub2 kscnwrp @488 0x0000
ub4 kcvcptim @492 0x2fce426e
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
BBED> set offset 500
OFFSET 500
BBED> dump /v count 30
File: /oracle/test/jiujian1.dbf (11)
Block: 1 Offsets: 500 to 529 Dba:0x02c00001
-------------------------------------------------------
08000000 02000000 00000000 02000000 l ................
00000000 00000000 00000000 0000 l ..............
<16 bytes per line>
BBED> modify /x b
Warning: contents of previous BIFILE will be lost. Proceed? (Y/N) y
File: /oracle/test/jiujian1.dbf (11)
Block: 1 Offsets: 500 to 529 Dba:0x02c00001
------------------------------------------------------------------------
0b000000 02000000 00000000 02000000 00000000 00000000 00000000 0000
<32 bytes per line>
BBED> set offset +8
OFFSET 508
BBED> dump /v
File: /oracle/test/jiujian1.dbf (11)
Block: 1 Offsets: 508 to 537 Dba:0x02c00001
-------------------------------------------------------
00000000 02000000 00000000 00000000 l ................
00000000 00000000 00000000 0000 l ..............
<16 bytes per line>
BBED> modify /x 10
File: /oracle/test/jiujian1.dbf (11)
Block: 1 Offsets: 508 to 537 Dba:0x02c00001
------------------------------------------------------------------------
10000000 02000000 00000000 00000000 00000000 00000000 00000000 0000
<32 bytes per line>
BBED> set offset 500
OFFSET 500
BBED> dump /v
File: /oracle/test/jiujian1.dbf (11)
Block: 1 Offsets: 500 to 529 Dba:0x02c00001
-------------------------------------------------------
0b000000 02000000 10000000 02000000 l ................
00000000 00000000 00000000 0000 l ..............
BBED> set offset 484
OFFSET 484
BBED> dump /v
File: /oracle/test/jiujian1.dbf (11)
Block: 1 Offsets: 484 to 513 Dba:0x02c00001
-------------------------------------------------------
5f7faea5 00000000 6e42ce2f 01000000 l _.....nB?....
0b000000 02000000 00000000 0200 l ..............
<16 bytes per line>
BBED> modify /x 81
File: /oracle/test/jiujian1.dbf (11)
Block: 1 Offsets: 484 to 513 Dba:0x02c00001
------------------------------------------------------------------------
817faea5 00000000 6e42ce2f 01000000 0b000000 02000000 00000000 0200
<32 bytes per line>
BBED> p kcvfhckp
struct kcvfhckp, 36 bytes @484
struct kcvcpscn, 8 bytes @484
ub4 kscnbas @484 0xa5ae7f81
ub2 kscnwrp @488 0x0000
ub4 kcvcptim @492 0x2fce426e
ub2 kcvcpthr @496 0x0001
union u, 12 bytes @500
struct kcvcprba, 12 bytes @500
ub4 kcrbaseq @500 0x0000000b
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 0x00
BBED> sum apply
Check value for File 11, Block 1:
current = 0x8957, required = 0x8957
4 更改数据文件头部后第二次恢复过程如下:
SQL> recover tablespace jiujian1;
ORA-00279: change 2779676545 generated at 12/14/2012 22:42:54 needed for thread
1
ORA-00289: suggestion : /oracle/archive/1_11_801995401.dbf
ORA-00280: change 2779676545 for thread 1 is in sequence #11
Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
auto
ORA-00279: change 2779676556 generated at 12/14/2012 22:44:45 needed for thread
1
ORA-00289: suggestion : /oracle/archive/1_12_801995401.dbf
ORA-00280: change 2779676556 for thread 1 is in sequence #12
ORA-00278: log file '/oracle/archive/1_11_801995401.dbf' no longer needed for
this recovery
ORA-00279: change 2779676566 generated at 12/14/2012 22:45:09 needed for thread
1
ORA-00289: suggestion : /oracle/archive/1_13_801995401.dbf
ORA-00280: change 2779676566 for thread 1 is in sequence #13
ORA-00278: log file '/oracle/archive/1_12_801995401.dbf' no longer needed for
this recovery
ORA-00279: change 2779676577 generated at 12/14/2012 22:45:38 needed for thread
1
ORA-00289: suggestion : /oracle/archive/1_14_801995401.dbf
ORA-00280: change 2779676577 for thread 1 is in sequence #14
ORA-00278: log file '/oracle/archive/1_13_801995401.dbf' no longer needed for
this recovery
Log applied.
Media recovery complete.
