The trial of Rman can achieve block-level data recovery. In the traditional restoration method, that is, a data block of a data file is damaged, the entire data file cannot be used for trial.
The trial of Rman can achieve block-level data recovery. In the traditional restoration method, that is, a data block of a data file is damaged, the entire data file cannot be used for trial.
RMAN implements block recovery
The trial of Rman can achieve block-level data recovery. In the traditional restoration method, that is, a data block of a data file is damaged, the entire data file cannot be used for trial, in this case, the entire data file must be restored through backup. Obviously, this method takes a long time, And RMAN implements block-level recovery. If the data in a data file is corrupted, the data block can be restored through the complete backup of the data file.
Case:
A database is a single-instance Oracle database with a total size of 700 GB.
The storage device uses Huawei storage, and the backup device uses Seagate 3 T mobile hard drive. This database has no DG and no OGG. The backup policy is to back up the entire database at every Saturday. The remaining time of level 1 differential backup on Wednesday is every day for Level 2 Differential backup. The full-Database Backup size is about GB.
2.2 fault situation
The cause of this failure is that the INSPUROA user reports an error in querying the EDOC_BASE_WORKFLOW table. Indicates that the fault block is datafile 5. The error message is as follows in the alter log:
Reading datafile '/oradata/datafiles/oadb/oa01.dbf' for upload uption at rdba: 0x016d4dd5 (file 5, block 2969045)
Reread (file 5, block 2969045) found same upload upt data (no logical check)
Tue Aug 18 10:53:51 2015
Corrupt Block Found
TSN = 6, TSNAME = OA
RFN = 5, BLK = 2969045, RDBA = 23940565
OBJN = 95690, OBJD = 95690, OBJECT = EDOC_BASE_WORKFLOW, SUBOBJECT =
Segment owner = INSPUROA, segment type = Table Segment
Tue Aug 18 10:55:03 2015
Hex dump of (file 5, block 2969045) in trace file/u01/app/oracle/diag/rdbms/oadb/trace/oadb_ora_4565.trc
Unzip upt block relative dba: 0x016d4dd5 (file 5, block 2969045)
Bad header found during buffer read
Data in bad block:
Type: 117 format: 0 rdba: 0x20206b73
Last change scn: 0x2020.20202020 seq: 0x20 flg: 0x20
Spare1: 0x64 spare2: 0x69 spare3: 0x0
Consistency value in tail: 0x4d240601
Check value in block header: 0x5f49
Block checksum disabled
Reading datafile '/oradata/datafiles/oadb/oa01.dbf' for upload uption at rdba: 0x016d4dd5 (file 5, block 2969045)
Reread (file 5, block 2969045) found same upload upt data (no logical check)
Tue Aug 18 10:55:03 2015
Corrupt Block Found
TSN = 6, TSNAME = OA
RFN = 5, BLK = 2969045, RDBA = 23940565
OBJN = 95690, OBJD = 95690, OBJECT = EDOC_BASE_WORKFLOW, SUBOBJECT =
Segment owner = INSPUROA, segment type = Table Segment
Tue Aug 18 10:57:29 2015
Hex dump of (file 5, block 2969045) in trace file/u01/app/oracle/diag/rdbms/oadb/trace/oadb_ora_21708.trc
Unzip upt block relative dba: 0x016d4dd5 (file 5, block 2969045)
Bad header found during buffer read
Data in bad block:
Type: 117 format: 0 rdba: 0x20206b73
Last change scn: 0x2020.20202020 seq: 0x20 flg: 0x20
Spare1: 0x64 spare2: 0x69 spare3: 0x0
Consistency value in tail: 0x4d240601
Check value in block header: 0x5f49
Block checksum disabled
Cause Analysis
Observe storage, no error warning, preliminary suspicion of bad logical Blocks
Execute repair
Based on the error message
Reading datafile '/oradata/datafiles/oadb/oa01.dbf' for upload uption at rdba: 0x016d4dd5 (file 5, block 2969045)
Reread (file 5, block 2969045) found same upload upt data (no logical check)
Corrupt Block Found
TSN = 6, TSNAME = OA
RFN = 5, BLK = 2969045, RDBA = 23940565
OBJN = 95690, OBJD = 95690, OBJECT = EDOC_BASE_WORKFLOW, SUBOBJECT =
Segment owner = INSPUROA, segment type = Table Segment
Determine the data file datafile 5 and oa01.dbf with bad Blocks
View bad block information:
SQL> select * from v $ database_block_corruption;
FILE # BLOCK # BLOCKS upload uption_change # upload uptio
---------------------------------------------------------
5 2969045 1 0 slave upt
Determine that the bad block is 2969045
Check whether the backup log (incremental, full) is completely backed up
Check whether the backup datafile 5 is complete
RMAN> backup validate datafile 5;
Starting backup at 18-AUG-15
Using target database control file instead of recovery catalog
Allocated channel: ORA_DISK_1
Channel ORA_DISK_1: SID = 982 device type = DISK
Channel ORA_DISK_1: starting full datafile backup set
Channel ORA_DISK_1: specifying datafile (s) in backup set
Input datafile file number = 00005 name =/oradata/datafiles/oadb/oa01.dbf
Channel ORA_DISK_1: backup set complete, elapsed time: 00:05:35
List of Datafiles
========================
File Status Marked upt Empty Blocks Examined High SCN
-------------------------------------------------------------
5 failures 0 1840 4190720 9484751217293
File Name:/oradata/datafiles/oadb/oa01.dbf
Block Type Blocks Failing Blocks Processed
----------------------------------------
Data 0 2842014
Index 0 182983
Other 1 1163883
Validate found one or more than upt blocks
See trace file/u01/app/oracle/diag/rdbms/oadb/trace/oadb_ora_13513.trc for details
Finished backup at 18-AUG-15
Execute repair
Use RMAN tools
RMAN> blockrecover datafile 5 blocks 2969045;
Starting recover at 18-AUG-15
Using channel ORA_DISK_1