天天看點

oracle 資料庫無法啟動,報錯 terminating the instance due to error 16014

前言:

早晨上班,開發告知資料庫連接配接不上,說是報記憶體溢出,檢視記憶體空餘空間确實不足,遂将高記憶體程序結束,但結束後還是連接配接不上,重新開機資料庫,悲劇發生了,資料庫居然啟不來了,因前一天改了下dastart檔案,已為是檔案改動的問題,但使用sqlpuls /as nolog登陸後 conn /as sysdba連接配接資料再startup也是啟不來。

之前沒有接觸過oracle資料庫,想先找找錯誤日志吧,看看有沒有報錯,結果一頓找,也沒找到錯誤日志在哪,不過後來找到一個啟動日志/oracle/app/oracle/diag/rdbms/orcl/orcl/alert/log.xml,一個終端監視這個日志問題,另一個終端再次startup,日志這邊有滾動了,滾了好多,關鍵在最後幾行,報錯了一條錯誤,以及錯誤記錄檔案/oracle/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_ora_6319.trc,内容如下

*** MODULE NAME:(sqlplus@test (TNS V1-V3)) 2015-09-17 11:17:30.014
*** ACTION NAME:() 2015-09-17 11:17:30.014
 
DDE: Problem Key 'ORA 312' was flood controlled (0x1) (no incident)
ORA-00312: online log 2 thread 1: '/oracle/app/oracle/oradata/orcl/redo02.log'
ORA-16014: log 2 sequence# 419 not archived, no available destinations
ORA-00312: online log 2 thread 1: '/oracle/app/oracle/oradata/orcl/redo02.log'

*** 2015-09-17 11:17:30.014
USER (ospid: 6319): terminating the instance due to error 16014      

确認錯誤就是

terminating the instance due to error 16014      

根據這個錯誤百度出幾條解決辦法,有一條和我情況類似,看到這标題吓我一跳,以為沒救了呢,不過還好,這是台測試機器

在此還意外發現了oracle錯誤日志的路徑

原位址:http://www.itpub.net/thread-1604189-1-1.html

sqlplus /nolog
SQL*Plus: Release 11.2.0.3.0 Production on Fri Apr 20 10:35:15 2012
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area  417546240 bytes
Fixed Size                  2228944 bytes
Variable Size             339742000 bytes
Database Buffers           67108864 bytes
Redo Buffers                8466432 bytes
Database mounted.
ORA-03113: end-of-file on communication channel
Process ID: 2558
Session ID: 125 Serial number: 5


[oracle@dg1 ~]$ tail -f /u01/app/oracle/diag/rdbms/dg1/dg/trace/alert_dg.log
Errors in file /u01/app/oracle/diag/rdbms/dg1/dg/trace/dg_ora_2743.trc:
ORA-16014: log 1 sequence# 63 not archived, no available destinations
ORA-00312: online log 1 thread 1: '/u01/app/oracle/oradata/dg/redo01.log'
USER (ospid: 2743): terminating the instance due to error 16014
Fri Apr 20 10:45:37 2012
System state dump requested by (instance=1, osid=2743), summary=[abnormal instance termination].
System State dumped to trace file /u01/app/oracle/diag/rdbms/dg1/dg/trace/dg_diag_2699.trc
Dumping diagnostic data in directory=[cdmp_20120420104537], requested by
 (instance=1, osid=2743), summary=[abnormal instance termination].
Instance terminated by USER, pid = 2743      

我也是在前一天嘗試做資料備份導出時開啟了oracle歸檔模式,當時是沒問題的,但資料導出一直報錯 TNS:could not resolve the connect identifier s,百度都說是環境變量問題,但我的環境變量都有,搞了一天也不知為何

sqlplus /nolog
SQL*Plus: Release 11.2.0.3.0 Production on Fri Apr 20 10:49:26 2012
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
SQL> conn /as sysdba
Connected to an idle instance.
SQL> startup mount
ORACLE instance started.
Total System Global Area  417546240 bytes
Fixed Size                  2228944 bytes
Variable Size             339742000 bytes
Database Buffers           67108864 bytes
Redo Buffers                8466432 bytes
Database mounted.
SQL> alter database noarchivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list;
Database log mode              No Archive Mode
Automatic archival             Disabled
Archive destination            /u01/app/oracle/standbylog
Oldest online log sequence     64
Current log sequence           66      
shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORACLE instance started.
Total System Global Area  417546240 bytes
Fixed Size                  2228944 bytes
Variable Size             339742000 bytes
Database Buffers           67108864 bytes
Redo Buffers                8466432 bytes
Database mounted.
SQL> alter database archivelog;
Database altered.
SQL> alter database open;
Database altered.
SQL> archive log list;
Database log mode              Archive Mode
Automatic archival             Enabled
Archive destination            /u01/app/oracle/standbylog
Oldest online log sequence     64
Next log sequence to archive   66
Current log sequence           66
一樣ok,沒有出現之前的63日志無法歸檔的問題,不過這個在生産庫上肯定意味着丢資料的!

繼續查詢備庫,發現日志隻到62,之後的日志再也傳不過來了,郁悶,資料丢失先不論,因為是測試庫,但至少dg是要重建了,悲劇!
SQL> select open_mode,database_role,db_unique_name from v$database;
OPEN_MODE            DATABASE_ROLE    DB_UNIQUE_NAME
-------------------- ---------------- ------------------------------
READ ONLY            PHYSICAL STANDBY dg2

SQL> select dest_id,applied,sequence# from v$archived_log where sequence# > 58 and dest_id=2;
   DEST_ID APPLIED    SEQUENCE#
---------- --------- ----------
         2 YES               59
         2 YES               60
         2 NO                61
         2 NO                62

這事給我的總結是,還是别用broker切換了,就算用,也别切的那麼快,慢慢來!今天真衰!