通過dbv和rman blockrecover對Oracle資料庫壞塊進行修複。
(1)rman備份時alert.log報如下錯誤:
Fri Jul 2 12:41:36 2010
Hex dump of (file 12, block 2718618) in trace file /u01/app/oracle/admin/bi/udump/bi_ora_31213.trc
Corrupt block relative dba: 0x03297b9a (file 12, block 2718618)
Fractured block found during backing up datafile
Data in bad block:
type: 6 format: 2 rdba: 0x03297b9a
last change scn: 0x0002.482fc15b seq: 0x1 flg: 0x06
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x77b20601
check value in block header: 0x253
computed block checksum: 0xb6e9
Reread of blocknum=2718618, file=/u01/oradata/BI/estaging_user01.712.714072365. found same corrupt data
Reread of blocknum=2718618, file=/u01/oradata/BI/estaging_user01.712.714072365. found same corrupt data
Reread of blocknum=2718618, file=/u01/oradata/BI/estaging_user01.712.714072365. found same corrupt data
Reread of blocknum=2718618, file=/u01/oradata/BI/estaging_user01.712.714072365. found same corrupt data
Reread of blocknum=2718618, file=/u01/oradata/BI/estaging_user01.712.714072365. found same corrupt data
(2)查詢資料庫,可知含有壞塊的對象:
SQL> col SEGMENT_NAME format a20
col PARTITION_NAME format a10
select owner,segment_name,partition_name from dba_extents where file_id = 12 and 2718618 between block_id and block_id + blocks-1;
OWNER SEGMENT_NAME PARTITION_
-------------------- -------------------- ----------
更多精彩內容:http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/
ESTAGING LOG_RECORD_DETAIL_4 P20100630
(3)但全表掃描卻沒有任何問題:
SQL> select count(*) from ESTAGING.LOG_RECORD_DETAIL_4 partition (P20100630);
COUNT(*)
----------
449937
SQL> select count(*) from ESTAGING.LOG_RECORD_DETAIL_4;
COUNT(*)
----------
42049608
(4)使用dbv檢查發現有一個壞塊(耗時較長):
$ dbv file=/u01/oradata/BI/estaging_user01.712.714072365 BLOCKSIZE=8192
DBVERIFY: Release 10.2.0.4.0 - Production on Fri Jul 2 14:15:49 2010
Copyright (c) 1982, 2007, Oracle. All rights reserved.
DBVERIFY - Verification starting : FILE = /u01/oradata/BI/estaging_user01.712.714072365
Page 2718618 is influx - most likely media corrupt
Corrupt block relative dba: 0x03297b9a (file 12, block 2718618)
Fractured block found during dbv:
Data in bad block:
type: 6 format: 2 rdba: 0x03297b9a
last change scn: 0x0002.482fc15b seq: 0x1 flg: 0x06
spare1: 0x0 spare2: 0x0 spare3: 0x0
consistency value in tail: 0x77b20601
check value in block header: 0x253
computed block checksum: 0xb6e9
DBVERIFY - Verification complete
Total Pages Examined : 2748160
Total Pages Processed (Data) : 2462446
Total Pages Failing (Data) : 0
Total Pages Processed (Index): 235234
Total Pages Failing (Index): 0
Total Pages Processed (Other): 24969
Total Pages Processed (Seg) : 0
Total Pages Failing (Seg) : 0
Total Pages Empty : 25510