官方针对ORA-01033的解释基本上是让用户等待一段时间后再次登陆,基于这种判断在于ORA-01033的本质是由于未完全加载而导致的进程忙碌所造成的,这种情况的合理解释确实可以是让用户等待到加载完毕。但是对于此种文件损坏的不可逆的操作,也就代表着永远不可能等到加载完毕的那一刻,因此,用等待并不一定能解决。
既然提示说是初始化或关闭还在进行中,我就关闭数据库,再一步步打开看报什么错。
SQL> conn / as sysdba
Connected.
SQL> show user
USER is "SYS"
SQL> select * from dual;
Connected.
SQL> show user
USER is "SYS"
SQL> select * from dual;
ADDR
INDX
INST_ID D
-------- ---------- ---------- -
0366CD54
0
1 X
--这里可以看出DUAL表中内容不正常了
-------- ---------- ---------- -
0366CD54
SQL> shutdown normal;
ORA-01109: database not open
ORA-01109: database not open
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area
176160768 bytes
Fixed Size
1247948 bytes
Variable Size
79693108 bytes
Database Buffers
92274688 bytes
Redo Buffers
2945024 bytes
Database mounted.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: 'D:/TT.DBF'
Fixed Size
Variable Size
Database Buffers
Redo Buffers
Database mounted.
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-01157: cannot identify/lock data file 6 - see DBWR trace file
ORA-01110: data file 6: 'D:/TT.DBF'
这下就很清楚了,找不到数据文件。
突然想起来昨天早上在论坛上回答一个朋友的问题,帮他做实验分析的时候创建了一个表空间TT,随便指定了一个路径'D:/TT.DBF'。完了到晚上我打开D盘突然发现有个TT.DBF,忘了自己创建过这个表空间,想都没想就给删掉了,最要命的我还是按着SHIFT彻底删除……
想了想,决定把表空间删除,应该就可以了,可惜结果不是这么简单。
SQL> select a.name from v$tablespace a,v$datafile b
2
where a.ts#=b.ts#;
NAME
------------------------------
SYSTEM
UNDOTBS1
SYSAUX
USERS
EXAMPLE
TT
------------------------------
SYSTEM
UNDOTBS1
SYSAUX
USERS
EXAMPLE
TT
6 rows selected.
SQL> drop tablespace tt including contents and datafiles;
drop tablespace tt including contents and datafiles
*
ERROR at line 1:
ORA-01109: database not open
drop tablespace tt including contents and datafiles
*
ERROR at line 1:
ORA-01109: database not open
数据库没打开,不让删除。好吧,我想到了表空间OFFLINE或者数据文件OFFLINE。
SQL> alter database datafile 'D:/TT.DBF' offline for drop;
Database altered.
SQL> alter database open;
Database altered.
SQL> select * from dual;
D
-
X
-
X
SQL> drop tablespace tt including contents and datafiles;
Tablespace dropped.
感谢作者文章解决了我的问题,引用文章来自:
http://blog.sina.com.cn/s/blog_79921f110100yath.html