Menu Close

ORA-01210: data file header is media corrupt

1. 故障现象

我自己的一个oracle数据库在打开后报如下错误:

SQL> startup
ORACLE instance started.

Total System Global Area 1660940440 bytes
Fixed Size               8896664 bytes
Variable Size            520093696 bytes
Database Buffers         1124073472 bytes
Redo Buffers             7876608 bytes
Database mounted.
ORA-01122: database file 51 failed verification check
ORA-01110: data file 51: '/u02/oradata/YKT/zytk/zytk35_ac02.dbf'
ORA-01210: data file header is media corrupt

2. 问题原因

~]$ oerr ora 01210
01210, 00000, "data file header is media corrupt"
// *Cause: The file header block is internally inconsistent. The beginning
//         of the block has a header with a checksum and other data for
//         insuring the consistancy of the block. It is possible that
//         the last disk write did not operate correctly. The most likely
//         problem is that this is not a datafile for any database.
// *Action: Have operating system make correct file available to database.
//         If the trace file dump indicates that only the checksum is wrong,
//         restore from a backup and do media recovery.

数据库: 12c 发布 1
错误代码: ORA-01210
描述: 数据文件标头发生介质损坏
原因: 文件头块在内部不一致。块的开头具有带校验和的标头和其他数据,以确保块的一致性。上次磁盘写入可能无法正确运行。最可能的问题是,这不是任何数据库的数据文件。
动作: 使操作系统使正确的文件可用于数据库。如果跟踪文件转储指示仅校验和错误,请从备份还原并进行媒体恢复。

3. 解决思路

3.1. 数据库有备份与归档时

执行RMAN恢复,参考:https://oracledbwr.com/data-recovery-advisor-in-oracle-database-19c/

RMAN>
restore datafile 51;
recover datafile 51;
alter database open;

3.2. 数据库无备份也无归档时

参考:http://blog.chinaunix.net/uid-12380499-id-5818041.html
https://www.codenong.com/cs109492476/