ORA-01122 ORA-01200 错误解析

ORA-01122: database file 9 failed verification check
ORA-01110: data file 9: '/mac01.dbf'
ORA-01200: actual file size of 64000 is smaller than correct size of 65600

[oracle@oel8 ~]$ 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.

[oracle@oel8 ~]$ oerr ora 1200
01200, 00000, "actual file size of %s is smaller than correct size of %s blocks"
// *Cause:  The size of the file as returned by the operating system is smaller
//         than the size of the file as indicated in the file header and the
//         control file. Somehow the file has been truncated. Maybe it is the
//         result of a half completed copy.
// *Action: Restore a good copy of the data file and do recovery as needed.





服务热线 : 13764045638   QQ号:47079569    邮箱:[email protected]



ORA-1110 、ORA-1122错误一起出现一般意味着对应号码/名字的数据文件存在问题, 而最底下的错误号一般能揭示该问题的本质,例如ORA-1200是说明数据文件的实际大小小于预期的大小。

针对有完整备份和归档的数据库可以尝试常规RESTORE、REOCOVER的方法来恢复该数据文件,而对于没哟任何形式物理备份的数据库而言,可以尝试使用DD等手段来修改数据文件大小,并绕过该问题。 注意这样做只是绕过问题而已,可能丢失的数据仍会丢失,并不会因此而恢复。

dd if= of=<output/target datafile> count=< > bs=
Taking the above example (First we take an dd backup of datafile):
dd if=/u02/oradata/careware/users01.dbf of=/tmp/corr_temp.DBF count=64000 bs=8192
Now add 1600 zero blocks to datafile /u02/oradata/careware/users01.dbf
dd if=/dev/zero of= bs= seek= count=
In parameter seek specify the block from which it should append 1600 blocks.
In this case since the file contains 64000 (as indicated by the error message) so seek=64001 which is the next block from where the append will occur.
dd if=/dev/zero of=/u02/oradata/careware/users01.dbf bs=8192 seek=64001 count=1600 conv=notrunc
Now check the file size at OS level (It should be 65600 * 8192 + 8192)bytes
Do a ls -lrt  to confirm the same.
Warning!! Once the database is open, export all the objects present in the tablespace containing the datafile. Please note that for any segment which had blocks that got
truncated at OS level, the export may fail if it tries to read data from the zero padded blocks. In that case it may be needed to apply a procedure to salvage good records.
Once export is complete, create a new tablespace and import the data.
Once it is confirmed that the data is good, drop the old tablespace.






Leave a Reply

Your email address will not be published. Required fields are marked *