日期:2014-05-16  浏览次数:20456 次

ORA-01033问题 以及 ORA-01145问题
因为离线误删本地表空间文件,导致ORA-01033,



但是在解决ORA-01033的过程中又遇到了ORA-01145的问题,


直接启动数据库时会报ORA-01033错误:

SQL> startup;
ORACLE instance started.

Total System Global Area  630521856 bytes
Fixed Size                  2146992 bytes
Variable Size             390073680 bytes
Database Buffers          230686720 bytes
Redo Buffers                7614464 bytes
Database mounted.
ERROR at line 1:
ORA-01157: cannot identify/lock data file 21 - see DBWR trace file
ORA-01110: data file 21: '/opt/oracle/oradata/sns/smpdata_zl.dbf'

对该文件进行一个offline操作,避免启动的时候读取该文件:
SQL> alter database datafile '/opt/oracle/oradata/sns/smpdata_zl.dbf' offline;
alter database datafile '/opt/oracle/oradata/sns/smpdata_zl.dbf' offline
*
ERROR at line 1:
ORA-01145: offline immediate disallowed unless media recovery enabled

offline操作时带上drop参数解决ORA-01145问题:
SQL> alter database datafile '/opt/oracle/oradata/sns/smpdata_zl.dbf' offline drop;

Database altered.

打开数据库:
SQL> alter database open;

Database altered.

到此两个问题均得到解决。