1. 程式人生 > >ORA-16038錯誤解決

ORA-16038錯誤解決

http://blog.sina.com.cn/s/blog_69f38bff0100n3dz.html

發現測試用的一個DB在startup時報如下錯誤:

SQL> alter database open;
alter database open
*
ERROR at line 1:
ORA-16038: log 1 sequence# 56 cannot be archived
ORA-19809: limit exceeded for recovery files
ORA-00312: online log 1 thread 1: '/u02/oradata/orcl/redo01.log'

從v$log中找到當前日誌狀態,可知當前日誌組是3,而group 1還未歸檔;

SQL> select group#,sequence#,archived,status from v$log;

    GROUP#  SEQUENCE# ARC STATUS
---------- ---------- --- ----------------
         1         56 NO  INACTIVE
         3         58 NO  CURRENT
         2         57 NO  INACTIVE

用alter database clear logfile命令嘗試重構logfile group 1,失敗;

SQL> alter database clear logfile group 1;
alter database clear logfile group 1
*
ERROR at line 1:
ORA-00350: log 1 of instance orcl (thread 1) needs to be archived
ORA-00312: online log 1 thread 1: '/u02/oradata/orcl/redo01.log'

失敗的原因是group 1還沒有歸檔,需要加上”unarchived”引數;

SQL> alter database clear unarchived logfile group 1;

Database altered.

成功,下面DB就可以正常open了;

SQL> alter database open;

Database altered.

SQL>