ORA-01200: actual file size of 4 is smaller than correct size of 128 blocks

数据库主机异常重启,遭遇ORA-01200: actual file size of 4 is smaller than correct size of 128 blocks

查看ora-01200报错是什么意思

oracle@test1:/home/oracle$ 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.
oracle@test1:/home/oracle$ 

根据报错信息,是控制文件记录的信息比实际上从操作系统中得到的文件大小不同。实际文件大小必控制文件记录的小。

1、查询控制文件记录的文件大小:为1M。

select file#,status,bytes/1024/1024 ,name from v$datafile;

 2、查看操作系统上文件的大小为40K。

3、dump数据文件头的信息

alter session set events 'immediate trace name FILE_HDRS level 10';

查看trace文件

4、如果有备份可以使用备份进行恢复。但是如果没有备份,该如何恢复呢?

方法一:

通过bbed工具,把数据文件构造到和控制文件记录的一模一样来骗过oracle。

1、bbed parfile=bbed.par

 2、修改数据文件大小为4

 3、open数据库

4、此时查看数据文件的大小

方法二:

1、使用dd命令在数据文件结尾添加124个块,使数据库达到1280个,一次骗过Oracle。

dd if=/dev/zero of=/u01/oradata/orcl/test_ind01.dbf bs=8192 seek=1280  count=124

2、open数据库

SQL> alter database open;

Database altered.

SQL> 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值