遭遇ORA-01200错误的原因及解决方法
1、案例现象
在数据库startup时,报错:
[oracle@localhost ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 10.2.0.1.0 - Production on Mon Sep 19 19:31:05 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 202445884 bytes
Fixed Size 451644 bytes
Variable Size 167772160 bytes
Database Buffers 33554432 bytes
Redo Buffers 667648 bytes
Database mounted.
ORA-01122: database file 1 failed verification check
ORA-01110: data file 1: '/u01/u01d/sysaux01.dbf'
ORA-01200: actual file size of 38400 is smaller than correct size of 51200 blocks
2、问题分析
SQL> select status from v$instance;
STATUS
------------
MOUNTED
SQL>
报错说,数据文件的实际大小与正确的大小较小。
SQL> col name for a50
SQL> select file#,status,bytes/1024/1024 mb,name from v$datafile;
FILE# STATUS MB NAME
---------- ------- ---------- --------------------------------------------------
1 SYSTEM 300 /u01/u01d/system01.dbf
2 ONLINE 100 /u01/u01d/undotbs01.dbf
3 SYSTEM 400 /u01/u01d/sysaux01.dbf
4 ONLINE 25 /u01/u01d/users01.dbf
5 ONLINE 25 /u01/u01d/indx01.dbf
6 ONLINE 100 /u01/u01d/perfstat.dbf
7 ONLINE 10 /u01/u01d/timi01.dbf
6 rows selected.
SQL>
可以看出控制文件记录的是400M,而du -sh system01.dbf结果是301M。接着,查阅在线帮助文档:
[oracle@localhost ~]$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
// controlfile. 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@localhost ~]$
可以看出,是数据文件的实际大小与控制文件和该数据文件的头部所记录的大小不同而引起的。一般是数据库异常导致的,在数据库的运行过程中,重新启动时,文件resize之后出现异常状况时都可能会遇到。下面看看怎么恢复,以打开数据库:
3、确定解决方案
首先转储数据文件头部看看:
SQL> alter session set events 'immediate trace name FILE_HDRS level 10';
Session altered.
SQL> @/u01/admin/mytools/myscripts/gettrcname.sql
TRACE_FILE_NAME
--------------------------------------------------------------------------------------------------------------
/u01/admin/denver/udump/denver_ora_4669.trc
SQL>
[oracle@localhost ~]$more /u01/admin/denver/udump/denver_ora_5349.trc
.....
FILE
相关新闻>>
- 发表评论
-
- 最新评论 更多>>