Email: service@parnassusdata.com 7 x 24 online support!

    You are here

    • You are here:
    • Home > Blogs > PDSERVICE's blog > Oracle 如何从错误ORA-01171 ORA-01122 ORA-01251 ORA-01186中恢复 ORA-01171: 数据文件 因高级检查点错误而将脱机

Oracle 如何从错误ORA-01171 ORA-01122 ORA-01251 ORA-01186中恢复 ORA-01171: 数据文件 因高级检查点错误而将脱机

Oracle 如何从错误ORA-01171 ORA-01122 ORA-01251 ORA-01186中恢复 ORA-01171: 数据文件 因高级检查点错误而将脱机

如果自己搞不定可以找诗檀软件专业ORACLE数据库修复团队成员帮您恢复!

诗檀软件专业数据库修复团队

服务热线 : 13764045638 QQ号:47079569 邮箱:service@parnassusdata.com

 

ORA-01171: 数据文件  因高级检查点错误而将脱机

oerr ora 1171
01171, 00000, "datafile %s going offline due to error advancing checkpoint"
// *Cause:  The checkpoint in the file header could not be advanced. See
//         accompanying errors for the reason. The datafile will be taken
//         offline the same as for a write error of a data block.
// *Action: See accompanying errors for details. Restore access to the file,
//         do media recovery, and bring it back online.
 
 
ORA-01251: 读取了文件号  的未知文件标头版本
 
oerr ora 1251
01251, 00000, "Unknown File Header Version read for file number %s"
// *Cause:  Read of the file header returned a record but its version cannot  
//         be identified.  Either the header has been corrupted, or the file
//         is not a valid database file.
// *Action: Have the operating system make the correct file available to  
//         the database, or recover the file. 
 
 
ORA-01186: 文件  验证测试失败
 
oerr ora 1186
01186, 00000, "file %s failed verification tests"   
// *Cause:  The data file did not pass the checks to insure it is part of the
//         database. See the accompanying error messages for the reason the   
//         verification failed.   
// *Action: Make the correct file available to the database. Then, either open
//         the database, or execute ALTER SYSTEM CHECK DATAFILES.  
 
 
ORA-01122: 数据库文件  验证失败
oerr ora 1122
01122, 00000, "database file %s failed verification check"
// *Cause:  The information in this file is inconsistent with information
//         from the control file. See accompanying message for reason.
// *Action: Make certain that the db files and control files are the correct
//         files for this database.
 

 

ORA-01171 oerr ora 1171
01171, 00000, "datafile %s going offline due to error advancing checkpoint"
// *Cause:  The checkpoint in the file header could not be advanced. See
//         accompanying errors for the reason. The datafile will be taken
//         offline the same as for a write error of a data block.
// *Action: See accompanying errors for details. Restore access to the file,
//         do media recovery, and bring it back online.
ORA-01122 oerr ora 1122
01122, 00000, "database file %s failed verification check"
// *Cause:  The information in this file is inconsistent with information
//         from the control file. See accompanying message for reason.
// *Action: Make certain that the db files and control files are the correct
//         files for this database.
ORA-01251 oerr ora 1251
01251, 00000, "Unknown File Header Version read for file number %s"
// *Cause:  Read of the file header returned a record but its version cannot  
//         be identified.  Either the header has been corrupted, or the file
//         is not a valid database file.
// *Action: Have the operating system make the correct file available to  
//         the database, or recover the file.  
ORA-01186 oerr ora 1186
01186, 00000, "file %s failed verification tests"   
// *Cause:  The data file did not pass the checks to insure it is part of the
//         database. See the accompanying error messages for the reason the   
//         verification failed.   
// *Action: Make the correct file available to the database. Then, either open
//         the database, or execute ALTER SYSTEM CHECK DATAFILES. 

适用于:

Oracle Database – Enterprise Edition – 版本 8.1.7.4 到10.2.0.1 [Release 8.1.7 到 10.2]
本文信息适用于任何平台。
症状
在读数据文件头时报告的损坏。

警报日志显示信息如:

ORA-01171: datafile 8 going offline due to error advancing checkpoint
ORA-01122: database file 8 failed verification check
ORA-01110: data file 8: ‘/oracle/test_lob12.dbf’
ORA-01251: Unknown File Header Version read for file number 8

ORA-01186: file 8 failed verification tests

 

原因

块文件头损坏(块1)。

这可能由于丢失的读或写,硬件问题,对Oracle的外部操作覆盖在块文件头中的内容导致的。

解决方案

方案 1:  从备份中还原数据文件

数据库需要在归档日志模式中。

使有问题的数据文件脱机,从备份中还原它,应用媒体恢复并重新将其设为联机:

SQL> alter database datafile <fileno> offline ;

在OS级别重命名文件(mv <original name> <original name_old>)

从备份中还原数据文件(rman 或使用受管理的备份)

恢复数据文件

SQL> alter database datafile <fileno> online;

 

方案 2:  数据文件的备份不可用,但从数据文件创建日期起的所有归档日志可用。

  1. 数据库必须在归档日志模式。
  2. 需要从数据文件被创建起所有的归档日志文件。
  3. 控制文件有数据文件创建信息。如果控制文件在数据文件被创建后重建,则下面的解决方案不起作用和步骤2将显示错误ORA-01178。

操作步骤:

步骤 1:

使有问题的数据文件脱机。

SQL> alter database datafile  ‘/oracle/test_lob12.dbf’ offline;

将文件复制到另外的备份位置。

步骤 2:

发出以下命令来重建文件:

SQL> alter database create datafile   ‘/oracle/test_lob12.dbf’;

步骤 3:

开始应用归档日志文件来重建数据文件。

SQL> Recover  datafile  ‘/oracle/test_lob12.dbf’;

步骤 4:

当恢复完成,使数据文件联机。

SQL> alter database datafile ‘/oracle/test_lob12.dbf’ online;

 

方案 3:  数据文件备份和归档日志不可用

解决方法是脱机数据文件并drop表空间:

alter database datafile ‘<file name and path>’ offline drop;
alter database open; (if the instance is down)
drop tablespace <tablespace name> including contents;