博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ora-01200错误的分析
阅读量:6280 次
发布时间:2019-06-22

本文共 2693 字,大约阅读时间需要 8 分钟。

一 触发
错误的原因
 
[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> 
 
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 ..............
 
 <16 bytes per line>
 
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
 
 <32 bytes per line>
 
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

 

本文转自 zhangxuwl 51CTO博客,原文链接:http://blog.51cto.com/jiujian/1100060,如需转载请自行联系原作者
你可能感兴趣的文章
iOS--环信集成并修改头像和昵称(需要自己的服务器)
查看>>
PHP版微信权限验证配置,音频文件下载,FFmpeg转码,上传OSS和删除转存服务器本地文件...
查看>>
教程前言 - 回归宣言
查看>>
PHP 7.1是否支持操作符重载?
查看>>
Vue.js 中v-for和v-if一起使用,来判断select中的option为选中项
查看>>
Java中AES加密解密以及签名校验
查看>>
定义内部类 继承 AsyncTask 来实现异步网络请求
查看>>
VC中怎么读取.txt文件
查看>>
如何清理mac系统垃圾
查看>>
企业中最佳虚拟机软件应用程序—Parallels Deskto
查看>>
Nginx配置文件详细说明
查看>>
怎么用Navicat Premium图标编辑器创建表
查看>>
Spring配置文件(2)配置方式
查看>>
MariaDB/Mysql 批量插入 批量更新
查看>>
ItelliJ IDEA开发工具使用—创建一个web项目
查看>>
solr-4.10.4部署到tomcat6
查看>>
切片键(Shard Keys)
查看>>
淘宝API-类目
查看>>
virtualbox 笔记
查看>>
Git 常用命令
查看>>