ORA-10873及ORA-01110错误导致数据库无法开启

因为在listener.ora中添加了一个参数,Oracle建议重启listener及数据库以使其生效。用SHUTDOWN IMMEDIATE关库时Oracle提示备份未完成,不允许关,一激动,用了SHUTDOWN ABORT,这下可好了,关上了,起不来了:

SQL> startup

ORACLE instance started.

Total System Global Area 313860096 bytes
Fixed Size 1336232 bytes
Variable Size 281021528 bytes
Database Buffers 25165824 bytes
Redo Buffers 6336512 bytes
Database mounted.
ORA-10873: file 4 needs to be either taken out of backup mode or media
recovered
ORA-01110: data file 4: ‘/home/oracle/app/oracle/oradata/orcl/users01.dbf’


数据库启动到MOUNTED状态,提示错误,尝试ALERT到OPEN状态:
SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-10873: file 4 needs to be either taken out of backup mode or media recovered
ORA-01110: data file 4: ‘/home/oracle/app/oracle/oradata/orcl/users01.dbf’

依旧不成功。
查询错误代码:

Oracle Error :: ORA-10873

file string needs to be either taken out of backup mode or media recovered

Cause:An attempt was made to open a database after an instance failure or SHUTDOWN ABORT interrupted an online backup.

Action:If the indicated file is not a restored backup, then issue the ALTER DATABASE END BACKUP command and open the database. If the file is a restored online backup, then apply media recovery to it and open the database.

错误很明显,在线备份过程被SHUTDOWN ABORT中断,我的库也不需要恢复什么备份,所以直接用ALTER DATABASE END BACKUP解决问题,然后起库:
SQL> alter database end backup;
Database altered.
SQL> alter database open;
Database altered.
SQL> select status from v$instance;
STATUS
————
OPEN

 

总结:典型由于不注意Oracle提示出现的错误。由于对备份恢复这块不太了解,不重视其重要性,盲目使用ABORT关库,导致了这个本来不应出现的错误。作为DBA,每一步都要慎重。虽然这不是生产库,不过,在做每一步操作的时候都要谨慎,养成这样的习惯,才能在生产库上应用自如。

 
 

参考:http://www.error-code.org.uk/view.asp?e=ORACLE-ORA-10873

普人特福的博客cnzz&51la for wordpress,cnzz for wordpress,51la for wordpress