Oracle Rman Repair Logic bad block

Source: Internet
Author: User
Tags dba

RMAN for Data block recovery
Rman can be used to achieve data block-level data recovery, in the traditional recovery means that a data file block is damaged, resulting in the entire data file can not be tried,
The entire data file must be recovered from the backup at this time. Obviously such a method will be longer, and rman implementation block-level recovery, if a data file data corruption, through a full backup of the data file can be
Recover data blocks.



Case:
The database is a single-instance Oracle database with a total size of 700G.
The storage device uses Huawei storage and the backup device uses the Seagate 3T removable hard drive. The database has no DG without OGG. The backup strategy is a weekly 60-point full-Library backup with a 2-level differential backup of 0 points per day for the rest of the weekly 30-point 1 differential backup. The full library backup size is around 500G.
2.2 Failure conditions
The cause of this failure is Inspuroa users in the Query Edoc_base_workflow table error. Tip Fault Bad block is datafile 5. The error message is taken to the alter log as follows:

Reading datafile '/oradata/datafiles/oadb/oa01.dbf ' for corruption at RDBA:0X016D4DD5 (file 5, block 2969045)
Reread (file 5, block 2969045) found same corrupt data (no logical check)
Tue 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 18 10:55:03 2015
Hex Dump of (file 5, block 2969045) in trace file/u01/app/oracle/diag/rdbms/oadb/oadb/trace/oadb_ora_4565.trc
Corrupt 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 corruption at RDBA:0X016D4DD5 (file 5, block 2969045)
Reread (file 5, block 2969045) found same corrupt data (no logical check)
Tue 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 18 10:57:29 2015
Hex Dump of (file 5, block 2969045) in trace file/u01/app/oracle/diag/rdbms/oadb/oadb/trace/oadb_ora_21708.trc
Corrupt 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




Analysis Reason
Observation storage, no error warning, preliminary suspected logical bad block
Perform the repair
According to the error message
Reading datafile '/oradata/datafiles/oadb/oa01.dbf ' for corruption at RDBA:0X016D4DD5 (file 5, block 2969045)
Reread (file 5, block 2969045) found same corrupt 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 data file datafile 5,oa01.dbf bad block phenomenon
To view bad block information:
Sql>select * from V$database_block_corruption;

file# block# BLOCKS corruption_change# corruptio
---------- ---------- ---------- ------------------ ---------
5 2969045 1 0 corrupt

Make sure the bad block is number No. 2969045.
Check backup log (incremental, full) for full backups
Check if 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 corrupt Empty Blocks Blocks examined high SCN
---- ------ -------------- ------------ --------------- ----------
5 FAILED 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 corrupt blocks
See Trace FILE/U01/APP/ORACLE/DIAG/RDBMS/OADB/OADB/TRACE/OADB_ORA_13513.TRC for details
Finished backup at 18-aug-15

Perform the repair
Using the Rman tool
Rman>blockrecover datafile 5 block 2969045;


Starting recover at 18-aug-15
Using channel Ora_disk_1

Channel ora_disk_1:restoring block (s)
Channel ora_disk_1:specifying block (s) to restore from backup set
Restoring blocks of datafile 00005
Channel ora_disk_1:reading from backup Piece/orabak_m/oadb/20150815_fullbkdb_ssqek9d1_1_1.bak
Channel Ora_disk_1:piece Handle=/orabak_m/oadb/20150815_fullbkdb_ssqek9d1_1_1.bak tag=tag20150815t000448
Channel ora_disk_1:restored block (s) from backup piece 1
Channel ora_disk_1:reading from backup Piece/orabak_m/oadb/20150815_fullbkdb_ssqek9d1_2_1.bak
Channel Ora_disk_1:piece Handle=/orabak_m/oadb/20150815_fullbkdb_ssqek9d1_2_1.bak tag=tag20150815t000448
Channel ora_disk_1:restored block (s) from backup piece 2
Channel ora_disk_1:reading from backup Piece/orabak_m/oadb/20150815_fullbkdb_ssqek9d1_3_1.bak
Channel Ora_disk_1:piece Handle=/orabak_m/oadb/20150815_fullbkdb_ssqek9d1_3_1.bak tag=tag20150815t000448
Channel ora_disk_1:restored block (s) from backup piece 3
Channel ora_disk_1:reading from backup Piece/orabak_m/oadb/20150815_fullbkdb_ssqek9d1_4_1.bak
Channel Ora_disk_1:piece Handle=/orabak_m/oadb/20150815_fullbkdb_ssqek9d1_4_1.bak tag=tag20150815t000448
Channel ora_disk_1:restored block (s) from backup piece 4
Channel Ora_disk_1:block restore complete, elapsed time:00:29:50

Starting Media recovery

Archived log for thread 1 with sequence 8341 are already on disk as FILE/ORABAK/ARCH/1_8341_802601679.DBF
Archived log for thread 1 with sequence 8342 are already on disk as FILE/ORABAK/ARCH/1_8342_802601679.DBF
Archived log for thread 1 with sequence 8343 are already on disk as FILE/ORABAK/ARCH/1_8343_802601679.DBF
Archived log for thread 1 with sequence 8344 are already on disk as FILE/ORABAK/ARCH/1_8344_802601679.DBF
Channel ora_disk_1:starting archived log restore to default destination
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8318
Channel ora_disk_1:reading from backup Piece/orabak_m/oadb/20150815_fullbkarc_t2qekhpb_1_1.bak
Channel Ora_disk_1:piece Handle=/orabak_m/oadb/20150815_fullbkarc_t2qekhpb_1_1.bak tag=tag20150815t022754
Channel ora_disk_1:restored backup Piece 1
Channel Ora_disk_1:restore complete, elapsed time:00:00:07
Channel ora_disk_1:starting archived log restore to default destination
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8319
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8320
Channel ora_disk_1:reading from backup Piece/orabak_m/oadb/20150816_inc_2bkair_t9qemurm_1_1.bak
Channel Ora_disk_1:piece Handle=/orabak_m/oadb/20150816_inc_2bkair_t9qemurm_1_1.bak tag=tag20150816t002318
Channel ora_disk_1:restored backup Piece 1
Channel Ora_disk_1:restore complete, elapsed time:00:00:15
Channel ora_disk_1:starting archived log restore to default destination
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8321
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8322
Channel ora_disk_1:reading from backup Piece/orabak_m/oadb/20150816_inc_2bkair_taqemurm_1_1.bak
Channel Ora_disk_1:piece Handle=/orabak_m/oadb/20150816_inc_2bkair_taqemurm_1_1.bak tag=tag20150816t002318
Channel ora_disk_1:restored backup Piece 1
Channel Ora_disk_1:restore complete, elapsed time:00:00:07
Channel ora_disk_1:starting archived log restore to default destination
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8323
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8324
Channel ora_disk_1:reading from backup Piece/orabak_m/oadb/20150817_inc_2bkair_thqepj8n_1_1.bak
Channel Ora_disk_1:piece Handle=/orabak_m/oadb/20150817_inc_2bkair_thqepj8n_1_1.bak tag=tag20150817t002350
Channel ora_disk_1:restored backup Piece 1
Channel Ora_disk_1:restore complete, elapsed time:00:00:16
Channel ora_disk_1:starting archived log restore to default destination
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8325
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8326
Channel ora_disk_1:reading from backup Piece/orabak_m/oadb/20150817_inc_2bkair_tiqepj8n_1_1.bak
Channel Ora_disk_1:piece Handle=/orabak_m/oadb/20150817_inc_2bkair_tiqepj8n_1_1.bak tag=tag20150817t002350
Channel ora_disk_1:restored backup Piece 1
Channel Ora_disk_1:restore complete, elapsed time:00:00:07
Channel ora_disk_1:starting archived log restore to default destination
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8327
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8328
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8329
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8330
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8331
Channel ora_disk_1:reading from backup Piece/orabak_m/oadb/20150818_inc_2bkair_tpqes7ml_1_1.bak
Channel Ora_disk_1:piece Handle=/orabak_m/oadb/20150818_inc_2bkair_tpqes7ml_1_1.bak tag=tag20150818t002453
Channel ora_disk_1:restored backup Piece 1
Channel Ora_disk_1:restore complete, elapsed time:00:00:35
Channel ora_disk_1:starting archived log restore to default destination
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8332
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8333
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8334
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8335
Channel ora_disk_1:reading from backup Piece/orabak_m/oadb/20150818_inc_2bkair_tqqes7ml_1_1.bak
Channel Ora_disk_1:piece Handle=/orabak_m/oadb/20150818_inc_2bkair_tqqes7ml_1_1.bak tag=tag20150818t002453
Channel ora_disk_1:restored backup Piece 1
Channel Ora_disk_1:restore complete, elapsed time:00:00:35
Channel ora_disk_1:starting archived log restore to default destination
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8336
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8337
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8338
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8339
Channel ora_disk_1:restoring archived Log
Archived Log thread=1 sequence=8340
Channel ora_disk_1:reading from backup Piece/orabak_m/oadb/20150818_inc_2bkair_trqes7ml_1_1.bak
Channel Ora_disk_1:piece Handle=/orabak_m/oadb/20150818_inc_2bkair_trqes7ml_1_1.bak tag=tag20150818t002453
Channel ora_disk_1:restored backup Piece 1
Channel Ora_disk_1:restore complete, elapsed time:00:00:25
Media recovery complete, elapsed time:00:00:16
Finished recover at 18-aug-15

Fix complete view alter log condition
Media Recovery log/orabak/arch/1_8336_802601679.dbf
Tue 18 12:04:29 2015
Media Recovery log/orabak/arch/1_8336_802601679.dbf (restored)
Media Recovery log/orabak/arch/1_8337_802601679.dbf
Media Recovery log/orabak/arch/1_8338_802601679.dbf
Media Recovery log/orabak/arch/1_8339_802601679.dbf
Media Recovery log/orabak/arch/1_8340_802601679.dbf
Recovery of Online Redo log:thread 1 Group 1 Seq 8341 Reading Mem 0
mem# 0:/orabak/logfile/redo01a.log
Recovery of Online Redo log:thread 1 Group 2 Seq 8342 Reading mem 0
mem# 0:/orabak/logfile/redo02a.log
Recovery of Online Redo log:thread 1 Group 3 Seq 8343 Reading mem 0
mem# 0:/orabak/logfile/redo03a.log
Recovery of Online Redo log:thread 1 Group 4 Seq 8344 Reading Mem 0
mem# 0:/orabak/logfile/redo04a.log
Recovery of Online Redo log:thread 1 Group 5 Seq 8345 Reading Mem 0
mem# 0:/orabak/logfile/redo05a.log
Completed Block Media Recovery

To query the fault block information:
Sql>select * from V$database_block_corruption;

No rows selected
To query the fault table information:
Sql> Select COUNT (1) from Inspuroa. Edoc_base_workflow;

COUNT (1)
----------
1393635

This article is from the "SYSDBA" blog, make sure to keep this source http://sysdba.blog.51cto.com/10492366/1703419

Oracle Rman Repair Logic bad block

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.