rman系列之BBED破坏,BlockRecover恢复的案例演示
环境:
[sql] www.2cto.com
sys@EMREP> select * from v$version where rownum=1;
BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
sys@EMREP> !uname -a
Linux localhost.localdomain 2.6.18-308.el5xen #1 SMP Fri Jan 27 17:59:00
EST 2012 i686 i686 i386 GNU/Linux
EST 2012 i686 i686 i386 GNU/Linux
之前有个坏块63,所以dbv校验时有2个坏块,所以rman备份时要设坏块容忍哈,
比较懒的,所以....
① 实验准备 www.2cto.com
[sql]
RMAN> run {
2> set maxcorrupt for datafile 4 to 1;
3> backup tablespace users;
4> }
executing command: SET MAX CORRUPT
Starting backup at 17-DEC-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backupset
channel ORA_DISK_1: specifying datafile(s) in backupset
input datafile fno=00004 name=/u01/app/oracle/oradata/emrep/users01.dbf
channel ORA_DISK_1: starting piece 1 at 17-DEC-12
channel ORA_DISK_1: finished piece 1 at 17-DEC-12
piece handle=/u01/app/oracle/flash_recovery_area/EMREP/backupset/2012_12_17/o1_mf_
nnndf_TAG20121217T205237_8dy5dor3_.bkp tag=TAG20121217T205237 comment=NONE
nnndf_TAG20121217T205237_8dy5dor3_.bkp tag=TAG20121217T205237 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 17-DEC-12
u1@EMREP> select t2.*,dbms_rowid.rowid_block_number(rowid) from t2;
B DBMS_ROWID.ROWID_BLOCK_NUMBER(ROWID)
---------- ------------------------------------
1 71
3 71
② BBED模拟坏块
[sql]
BBED> set file 4
FILE# 4
BBED> modify 1000 file 4 block 71
File: /u01/app/oracle/oradata/emrep/users01.dbf (4)
Block: 71 Offsets: 0 to 511 Dba:0x01000047
------------------------------------------------------------------------
03e80000 47000001 a63e0400 00000406 454c0000 01000000 3d290000 993e0400
00000000 02003200 41000001 09001400 7e000000 ba008000 48001a00 02200000
a63e0400 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00010200 ffff1600 8c1f701f 701f0000 0200921f 8c1f0000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
<32 bytes per line>
BBED> verify
DBVERIFY - Verification starting
FILE = /u01/app/oracle/oradata/emrep/users01.dbf
BLOCK = 71
Block 71 is corrupt
Corrupt block