错误示例
block corrupt 的log
Current log# 12 seq# 47247 mem# 0: /data2/obs5_db/obs5_log/obs5_redo_12.log
***
Corrupt block relative dba: 0x0f457f48 file=61. blocknum=360264.
Fractured block found during buffer read
Data in bad block - type:6. format:2. rdba:0x0f457f48 |
解决方法
用Oracle的工具包
首先需要用dbms_repair.check_object先检查一下,然后再用dbms_repair.fix_corrupt_blocks修复,如果修复不了,你可以用dbms_repair.skip_corrupt_blocks
具体过程的说明:
DBMS_REPAIR.CHECK_OBJECT (
schema_name IN VARCHAR2,
object_name IN VARCHAR2,
partition_name IN VARCHAR2 DEFAULT NULL,
object_type IN BINARY_INTEGER DEFAULT TABLE_OBJECT,
repair_table_name IN VARCHAR2 DEFAULT ’REPAIR_TABLE’,
flags IN BINARY_INTEGER DEFAULT NULL,
relative_fno IN BINARY_INTEGER DEFAULT NULL,
block_start IN BINARY_INTEGER DEFAULT NULL,
block_end IN BINARY_INTEGER DEFAULT NULL,
corrupt_count OUT BINARY_INTEGER);
DBMS_REPAIR.FIX_CORRUPT_BLOCKS (
schema_name IN VARCHAR2,
object_name IN VARCHAR2,
partition_name IN VARCHAR2 DEFAULT NULL,
object_type IN BINARY_INTEGER DEFAULT TABLE_OBJECT,
repair_table_name IN VARCHAR2 DEFAULT ’REPAIR_TABLE’,
flags IN BINARY_INTEGER DEFAULT NULL,
fix_count OUT BINARY_INTEGER);
DBMS_REPAIR.SKIP_CORRUPT_BLOCKS (
schema_name IN VARCHAR2,
object_name IN VARCHAR2,
object_type IN BINARY_INTEGER DEFAULT TABLE_OBJECT,
flags IN BINARY_INTEGER DEFAULT SKIP_FLAG); |
dbv
你也可以用dbv工具看一下你现在其他的数据文件有没有还有坏块的
dbv file='yourfilename'
具体的恢复方法
在Oracle数据库出现坏块时,Oracle会在警告日志文件(alert_SID.log)中记录坏块的信息:
ORA-01578: ORACLE data block corrupted (file # 7, block # )
ORA-01110: data file : '/oracle1/oradata/V920/oradata/V816/users01.dbf' |
请注意:<AFN>代表坏块所在数据文件的绝对文件号,代表坏块是数据文件上的第几个数据块,出现这种情况时,应该首先检查是否是硬件及操作系统上的故障导致Oracle数据库出现坏块。在排除了数据库以外的原因后,再对发生坏块的数据库对象进行处理。
1.确定发生坏块的数据库对象
SELECT tablespace_name,
segment_type,
owner,
segment_name
FROM dba_extents
WHERE file_id =
AND between block_id AND block_id+blocks-1; | |