17,377
社区成员
发帖
与我相关
我的任务
分享
ORA-01171: datafile 88 going offline due to error advancing checkpoint
ORA-01122: database file 88 failed verification check
ORA-01110: data file 88: '/u01/oracle/app/oradata/orcl/test01.dbf'
ORA-01251: Unknown File Header Version read for file number 88
在这之前 执行了:
BBED> info
File# Name Size(blks)
----- ---- ----------
88 /u01/oracle/app/oradata/orcl/test01.dbf 6400
BBED> modify 22 55
然后
SQL>alter system checkpoint;
SQL> conn test/test
Connected.
SQL> select count(*) from test.t1;
select count(*) from test.t1
*
ERROR at line 1:
ORA-00376: file 88 cannot be read at this time
ORA-01110: data file 88: '/u01/oracle/app/oradata/orcl/test01.dbf'
SQL> select * from v$database_block_corruption where file#=2;
FILE# BLOCK# BLOCKS CORRUPTION_CHANGE# CORRUPTION_TYPE
---------- ---------- ---------- ------------------ ------------------
2 1204 1 0 CHECKSUM
2 1101 1 0 CHECKSUM
2 1409 1 0 CHECKSUM
已用时间: 00: 00: 00.32
已用时间: 00: 00: 00.17
-- 现在可以通过备份来进行基于数据块级别的恢复:
RMAN> blockrecover datafile 2 block 1204 from backupset;
RMAN> blockrecover datafile 2 block 1101 from backupset;
RMAN> blockrecover datafile 2 block 1409 from backupset;
......
-- 完成恢复之后,可以登录数据库查询:
SQL> select * from v$database_block_corruption where file#=2;
FILE# BLOCK# BLOCKS CORRUPTION_CHANGE# CORRUPTION_TYPE
---------- ---------- ---------- ------------------ ------------------
2 1050 1 0 CHECKSUM
SQL> select count(*) from t;
-- 此时数据已经恢复,但是 block corruption 信息仍然记录在数据库中,直到下次 validate 才会清除这部分信息:
D:\> rmant target /
......
RMAN> backup validate datafile 2;
......
-- 此时从数据库中查询,坏块信息被清除。
SQL> select * from v$database_block_corruption where file#=2;