您好,欢迎访问一九零五行业门户网

ORA-01200错误的分析

一 触发ora-01200错误的原因 [oracle@oracle ~]$ oerr ora 0120001200, 00000, actual file size of %s is smaller than correc
一 触发ora-01200错误的原因
[oracle@oracle ~]$ oerr ora 01200
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.
数据文件实际块数小于数据文件头部记录的数据文件块数
二 用bbed构造一个ora-01200错误
1 数据文件/oracle/test/jiujian1.dbf实际占用块数如下:
sql> select file_name,blocks from dba_data_files where file_id=11;
file_name                          blocks
----------------------------------------          ---------
/oracle/test/jiujian1.dbf                1048
2 用bbed修改数据文件头部记录的数据文件占用块数
bbed> info
 file# name                                                        size(blks)
 ----- ----                                                        ----------
    1 /oracle/crm2/system1.dbf                                        61440
    2 /oracle/crm2/zxb.dbf                                              1280
    3 /oracle/crm2/crm/sysaux01.dbf                                    37120
    4 /oracle/crm2/crm/users01.dbf                                      640
    5 /oracle/crm2/zxa.dbf                                            12800
    6 /oracle/crm2/crm/undotbs2.dbf                                    25600
    7 /oracle/crm2/zxc.dbf                                              1280
    8 /oracle/crm2/crm/zxbig1.dbf                                    262144
    11 /oracle/test/jiujian1.dbf                                          128
bbed> set dba 11,1
        dba            0x02c00001 (46137345 11,1)
bbed> p  offset 44     
kcvfh.kcvfhhdr.kccfhfsz
-----------------------
ub4 kccfhfsz                                @44      0x00000418 (十进制1048)
bbed> set offset 44
        offset          44
bbed> dump /v count 30
 file: /oracle/test/jiujian1.dbf (11)
 block: 1      offsets:  44 to  73 dba:0x02c00001
-------------------------------------------------------
 18040000 00200000 0b000300 00000000 l ..... ..........
 00000000 00000000 00000000 0000    l ..............
bbed> modify /x 1904
warning: contents of previous bifile will be lost. proceed? (y/n) y
 file: /oracle/test/jiujian1.dbf (11)
 block: 1                offsets:  44 to  73          dba:0x02c00001
------------------------------------------------------------------------
 19040000 00200000 0b000300 00000000 00000000 00000000 00000000 0000
bbed> p offset 44
kcvfh.kcvfhhdr.kccfhfsz
-----------------------
ub4 kccfhfsz                                @44      0x00000419(10进制为1049)
bbed> sum apply
check value for file 11, block 1:
current = 0x34f4, required = 0x34f4
3 启动数据库便可触发ora-01200错误
sql> startup
oracle instance started.
total system global area 322961408 bytes
fixed size                  2020480 bytes
variable size              92277632 bytes
database buffers          222298112 bytes
redo buffers                6365184 bytes
database mounted.
ora-01122: database file 11 failed verification check
ora-01110: data file 11: '/oracle/test/jiujian1.dbf'
ora-01200: actual file size of 1048 is smaller than correct size of 1049 blocks
三ora-01200错误的解决
方式1 通过bbed 改数据文件头部偏移量44处的值为数据文件实际占用块数
方式2 通过dd命令填充数据文件实际大小为correct size of 1049 blocks中的值
dd if=/dev/zero of=/oracle/test/jiujian1.dbf bs=8192 count=1 seek=1049
相关阅读:
spfile 错误导致数据库无法启动(ora-01565) 
ora-01172、ora-01151错误处理 
ora-00600 [2662]错误解决

其它类似信息

推荐信息