標籤:oracle
前言:
早晨上班,開發告知資料庫連接不上,說是報記憶體溢出,查看記憶體空餘空間確實不足,遂將高記憶體進程結束,但結束後還是串連不上,重啟資料庫,悲劇發生了,資料庫居然啟不來了,因前一天改了下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:([email protected] (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 destinationsORA-00312: online log 2 thread 1: ‘/oracle/app/oracle/oradata/orcl/redo02.log‘*** 2015-09-17 11:17:30.014USER (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 /nologSQL*Plus: Release 11.2.0.3.0 Production on Fri Apr 20 10:35:15 2012Copyright (c) 1982, 2011, Oracle. All rights reserved.SQL> conn /as sysdbaConnected to an idle instance.SQL> startupORACLE instance started.Total System Global Area 417546240 bytesFixed Size 2228944 bytesVariable Size 339742000 bytesDatabase Buffers 67108864 bytesRedo Buffers 8466432 bytesDatabase mounted.ORA-03113: end-of-file on communication channelProcess ID: 2558Session ID: 125 Serial number: 5[[email protected] ~]$ tail -f /u01/app/oracle/diag/rdbms/dg1/dg/trace/alert_dg.logErrors in file /u01/app/oracle/diag/rdbms/dg1/dg/trace/dg_ora_2743.trc:ORA-16014: log 1 sequence# 63 not archived, no available destinationsORA-00312: online log 1 thread 1: ‘/u01/app/oracle/oradata/dg/redo01.log‘USER (ospid: 2743): terminating the instance due to error 16014Fri Apr 20 10:45:37 2012System 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.trcDumping 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 /nologSQL*Plus: Release 11.2.0.3.0 Production on Fri Apr 20 10:49:26 2012Copyright (c) 1982, 2011, Oracle. All rights reserved.SQL> conn /as sysdbaConnected to an idle instance.SQL> startup mountORACLE instance started.Total System Global Area 417546240 bytesFixed Size 2228944 bytesVariable Size 339742000 bytesDatabase Buffers 67108864 bytesRedo Buffers 8466432 bytesDatabase mounted.SQL> alter database noarchivelog;Database altered.SQL> alter database open;Database altered.SQL> archive log list;Database log mode No Archive ModeAutomatic archival DisabledArchive destination /u01/app/oracle/standbylogOldest online log sequence 64Current log sequence 66
再次開啟歸檔模式(此步尚未操作,記錄在此方便後期操作尋找)
shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL> startup mountORACLE instance started.Total System Global Area 417546240 bytesFixed Size 2228944 bytesVariable Size 339742000 bytesDatabase Buffers 67108864 bytesRedo Buffers 8466432 bytesDatabase mounted.SQL> alter database archivelog;Database altered.SQL> alter database open;Database altered.SQL> archive log list;Database log mode Archive ModeAutomatic archival EnabledArchive destination /u01/app/oracle/standbylogOldest online log sequence 64Next log sequence to archive 66Current 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 dg2SQL> 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切換了,就算用,也別切的那麼快,慢慢來!今天真衰!
oracle 資料庫無法啟動,報錯 terminating the instance due to error 16014