Demonstration of BBED damage and BlockRecover recovery in rman Series

Source: Internet
Author: User

[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 there was a bad block 63 Before GNU/Linux, so dbv verification has two bad blocks, so we need to set bad block tolerance during rman backup,
So .... ① run {2> set maxcompute upt for datafile 4 to 1; 3> backup tablespace users; 4 >}executing command: set max sort upt 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 channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01 Finished backup at 17-DEC-12 u1 @ EMREP> select t2. *, round (rowid) from t2; B DBMS_ROWID.ROWID_BLOCK_NUMBER (ROWID) ---------- ------------------------------------ 1 71 3 71 ② BBED simulate Bad blocks [SQL] BBED> set file 4 FILE #4 BBED> modify 1000 file 4 bl Ock 71 File:/u01/app/oracle/oradata/emrep/users01.dbf (4) Block: 71 Offsets: 0 to 511 Dba: 0x01000047 10903e80000 47000001 a63e0400 00000406 454c0000 01000000 3d290000 993e0400 00000000 02003200 41000001 09001400 7e000000 ba008000 48001a00 02200000 a63e0400 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 0000 0000 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 invalid upt blocks upt block relative dba: 0x01000047 (file 0, block 71) Bad header found during verification Data in bad block: type: 3 forma T: 0 rdba: 0x01000047 last change scn: 0x0000. 00043ea6 seq: 0x4 flg: 0x06 spare1: 0x0 spare2: 0x0 spare3: 0x0 consistency value in tail: 0x3ea60604 check value in block header: 0x4c45 computed block checksum: 0x4a05 DBVERIFY-Verification complete Total Blocks Examined: 1 Total Blocks Processed (Data): 0 Total Blocks Failing (Data): 0 Total Blocks Processed (Index ): 0 Total Blocks Failing (Ind Ex): 0 Total Blocks Empty: 0 Total Blocks Marked Blocks upt: 1 Total Blocks Influx: 0 ③ SQLPLUS check [SQL] u1 @ EMREP> conn/as sysdba Connected. sys @ EMREP> startup force; ORACLE instance started. total System Global Area 524288000 bytes Fixed Size 1220384 bytes Variable Size 247464160 bytes Database Buffers 272629760 bytes Redo Buffers 2973696 bytes Database mounted. database opened. sys @ EMREP> conn U1/u1 Connected. u1 @ EMREP> select * from t2; select * from t2 * ERROR at line 1: ORA-01578: ORACLE data block Partition upted (file #4, block #71) ORA-01110: data file 4: '/u01/app/oracle/oradata/emrep/users01.dbf' ④ DBV confirm again [SQL] [oracle @ localhost ~] $ Dbv file =/u01/app/oracle/oradata/emrep/users01.dbf DBVERIFY: Release 10.2.0.1.0-Production on Mon Dec 17 21:00:48 2012 Copyright (c) 1982,200 5, Oracle. all rights reserved. DBVERIFY-Verification starting: FILE =/u01/app/oracle/oradata/emrep/users01.dbf Page 63 is marked ready upt block relative dba: 0x000003f (file 4, block 63) bad header found during dbv: Data in bad block: type: 3 format: 0 rdba: 0x000003f last change scn: 0x0000. 00050c11 seq: 0x1 flg: 0x06 spare1: 0x0 spare2: 0x0 spare3: 0x0 consistency value in tail: 0x0c110601 check value in block header: 0xd375 computed block checksum: 0x4a05 Page 71 is marked when upt block relative dba: 0x01000047 (file 4, block 71) Bad header found during dbv: Data in bad block: type: 3 format: 0 rdba: 0x01000047 last change scn: 0x0000. 00043ea6 seq: 0x4 flg: 0x06 spare1: 0x0 spare2: 0x0 spare3: 0x0 consistency value in tail: 0x3ea60604 check value in block header: 0x4c45 computed block checksum: 0x4a05 DBVERIFY-Verification complete Total Pages Examined: 640 Total Pages Processed (Data): 39 Total Pages Failing (Data): 0 Total Pages Processed (Index ): 6 Total Pages Failing (Index): 0 Total Pages Processed (Other): 45 Total Pages Processed (Seg): 0 Total Pages Failing (Seg): 0 Total Pages Empty: 548 Total Pages Marked primary upt: 2 Total Pages Influx: 0 Highest block SCN: 330790 (0.330790) ⑤ RMAN fixed [SQL] RMAN> blockrecover datafile 4 block 71; starting blockrecover at 17-DEC-12 using target database control file instead of recovery catalog allocated channel: ORA_DISK_1 channel ORA_DISK_1: sid = 538 devtype = DISK channel ORA_DISK_1: restoring block (s) channel ORA_DISK_1: specifying block (s) to restore from backup set restoring blocks of datafile 00004 channel ORA_DISK_1: reading from backup piece/u01/app/oracle/flash_recovery_area/EMREP/backupset/2012_12_17/snapshot _
Stored _. bkp channel ORA_DISK_1: restored block (s) from backup piece 1 piece handle =/u01/app/oracle/flash_recovery_area/EMREP/backupset/2012_12_17/o1_mf _
Nnndf_TAG20121217T205237_8dy5dor3 _. bkp tag = TAG20121217T205237 channel ORA_DISK_1: block restore complete, elapsed time: 00:00:02 starting media recovery complete, elapsed time: 00:00:07 Finished blockrecover at 17-DEC-12 6 data verification: www.2cto.com [SQL] sys @ EMREP> conn u1/u1 Connected. u1 @ EMREP> select * from t2; B ---------- 1 3 7 Note: BLOCKRECOVER DATAFILE 9 BLOCK 13 DATAFILE 2 BLOCK 19 RESTORE
SCN 100; The UNTIL keyword in BLOCKRECOVER statement does not indicate Incomplete recovery of UNTIL. It means restoring the data block (restore) from the backup generated on a specific date or before SCN) after the restoration is complete, the recover logs related to the data block will be applied along with the OCP-043 questions

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.