RMAN出現檔案損壞ORA-19566: exceeded limit of 0 corrupt blocks 處理

tolywang發表於2007-03-03
http://www.itpub.net/showthread.php?s=&threadid=727648

Primary DB:
Linux AS3.0 + Oracle 9.2.0.4 RAC



output filename=/backup/ocfs_data/intel/tools01.dbf recid=362 stamp=615574424
channel dmd2: copied datafile 7
output filename=/backup/ocfs_data/intel/users01.dbf recid=363 stamp=615574428
channel dmd2: copied datafile 8
output filename=/backup/ocfs_data/intel/xdb01.dbf recid=364 stamp=615574437
channel dmd2: copied datafile 9
output filename=/backup/ocfs_data/intel/undotbs02.dbf recid=365 stamp=615574645
released channel: dmd2
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03009: failure of copy command on dmd2 channel at 02/26/2007 16:56:10
ORA-19566: exceeded limit of 0 corrupt blocks for file /ocfs_data/intel/base_data01.dbf
ORA-19600: input file is datafile 10 (/ocfs_data/intel/base_data01.dbf)
ORA-19601: output file is datafile-copy 0 (/backup/ocfs_data/intel/base_data01.dbf)

RMAN>
RMAN>
RMAN>
RMAN> **end-of-file**

***
Corrupt block relative dba: 0x0280cab8 (file 10, block 51896)
Fractured block found during datafile copy
Data in bad block -
type: 0 format: 2 rdba: 0x0000cab8
last change scn: 0x0000.00000000 seq: 0x1 flg: 0x05
consistency value in tail: 0x00000000
check value in block header: 0xcdb8, computed block checksum: 0x1
spare1: 0x0, spare2: 0x0, spare3: 0x0
***

一下是回覆:


應該是file 10 的塊51896損壞

如果有備份的話使用blockrecover修復一下


-------------------------------------------------

Find the segment and rebuild it.

If it is an index, rebuild it directly.
If it is a table, can you query all rows from it?

查詢壞塊:

SELECT segment_name,segment_type,extent_id,block_id, blocks
from dba_extents t
where file_id = 41
AND 55692 between block_id and (block_id + blocks - 1)

--------------------------------------------------------------------------

SELECT segment_name,segment_type,extent_id,block_id, blocks
from dba_extents t
where file_id = 10
AND 51896 between block_id and (block_id + blocks - 1) ;

查了下, 還好, 是一個小表, 不知道是否能exp然後匯入,還是move tablespace ? 不清楚其他的data儲存到這裡了是否會導致同樣的問題 ??

Recovering the Data Blocks
Surprisingly, the recovery mechanism is simple and can be done online.
Shutting down the database or disconnecting the users is unnecessary.
Example 1: Recovering data blocks individually. You may want to
recover individual data blocks, if you know the file-id(s) and block-id(s).
You may get this information from the log files of the backup process,
alert.log file, v$backup_corruption, v$copy_corruption,
v$database_block_corruption views, or from users. The last one is not
aimed at though.

RMAN> BLOCKRECOVER DATAFILE 10 BLOCK 51896;

Exp and imp the table will be okay .

----------------------------------------------------------------------------------

可以成功執行 select count(*) .

你可以用standby 庫的相同的檔案修復這個檔案的這個塊啊?
SORRY,看錯了,還以為你是DATAGUARD,還是EXP/IMP吧.

--------------------------------------------------------------------------------------

既然select count(*) 能夠成功
那麼你試驗一下create table table_bak as select * from table
能否成功
如果不行使用
ALTER SYSTEM SET EVENTS='10231 trace name context forever,level 10';
這是內部事件,設定在全表掃描時跳過損壞的資料塊.
然後匯出該表進行重建,在匯出的過程中要注意匯出的資料總數與select count(*) 是否一致,如果不一致那麼說明有資料丟失,你得確認能否允許這些資料的丟失

---------------------------------------------------------------------------------------

可以參考一下Oracle Database 10g:Administration Workshop II SG的12章 Dealing with database corruption.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/35489/viewspace-84507/,如需轉載,請註明出處,否則將追究法律責任。

相關文章