誤刪重做日誌檔案組導致啟動資料庫報錯ORA-03113
聽不止一個人說起,學技術就要不斷地折騰、搞破壞,比如說備份恢復,你就可以嘗試刪檔案,不管是日誌檔案、臨時檔案、資料檔案還是system檔案。刪了之後,重啟資料庫肯定報錯,有的甚至當時資料庫就掛掉,這樣你就可以學著恢復,一破一立之間,很多常規的備份恢復手段也就算是領教了。我今天就嘗試著把虛擬機器上的一個重做日誌檔案組刪除。
1.環境準備
我們在Oracle11g中進行測試,資料庫處於非歸檔狀態。
點選(此處)摺疊或開啟
-
SQL>
-
-
SQL> select * from v$version;
-
-
-
-
BANNER
-
-
--------------------------------------------------------------------------------
-
-
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
-
-
PL/SQL Release 11.2.0.3.0 - Production
-
-
CORE 11.2.0.3.0 Production
-
-
TNS for Linux: Version 11.2.0.3.0 - Production
-
-
NLSRTL Version 11.2.0.3.0 - Production
-
-
-
-
SQL>
-
-
SQL> archive log list;
-
-
Database log mode No Archive Mode
-
-
Automatic archival Disabled
-
-
Archive destination /u01/app/oracle/product/11.2.0/dbhome_1/dbs/arch
-
-
Oldest online log sequence 9
-
-
Current log sequence 11
-
- SQL>
2.刪除一個重做日誌檔案組,重啟資料庫報錯
首先,透過查詢v$log檢視來獲取資料庫重做日誌檔案組的狀態。
然後,透過ls命令檢視資料檔案,刪除第一個重做日誌檔案組(該檔案組只有一個日誌成員)。
重啟資料庫,資料庫報錯。
點選(此處)摺疊或開啟
-
SQL> select GROUP#,MEMBERS,ARCHIVED,STATUS from v$log;
-
-
-
-
GROUP# MEMBERS ARC STATUS
-
-
---------- ---------- --- ----------------
-
-
1 1 NO INACTIVE
-
-
2 1 NO CURRENT
-
-
3 1 NO INACTIVE
-
-
-
- SQL>
點選(此處)摺疊或開啟
-
[oracle@ hoegh HOEGH]$ ls
-
-
control01.ctl redo01.log sysaux01.dbf undotbs01.dbf
-
-
control02.ctl redo02.log system01.dbf users01.dbf
-
-
example01.dbf redo03.log temp01.dbf
-
-
[oracle@hoegh HOEGH]$
-
-
[oracle@hoegh HOEGH]$
-
-
[oracle@hoegh HOEGH]$ rm redo01.log
-
-
[oracle@hoegh HOEGH]$ ls
-
- control01.ctl control02.ctl example01.dbf redo02.log redo03.log sysaux01.dbf system01.dbf temp01.dbf undotbs01.dbf users01.dbf
點選(此處)摺疊或開啟
-
SQL>
-
-
SQL> shu immediate
-
-
Database closed.
-
-
Database dismounted.
-
-
ORACLE instance shut down.
-
-
SQL> startup
-
-
ORACLE instance started.
-
-
-
-
Total System Global Area 941600768 bytes
-
-
Fixed Size 1348860 bytes
-
-
Variable Size 515902212 bytes
-
-
Database Buffers 419430400 bytes
-
-
Redo Buffers 4919296 bytes
-
-
Database mounted.
-
-
ORA-03113: end-of-file on communication channel
-
-
Process ID: 5196
-
-
Session ID: 125 Serial number: 5
-
-
-
-
-
-
SQL>
-
-
SQL> select status from v$instance;
-
-
ERROR:
-
-
ORA-03114: not connected to ORACLE
-
-
-
-
-
- SQL>
3.檢視報警日誌檔案,定位問題
ORA-03113報錯是一個非常經典的報錯,報錯原因多種多樣,從報錯資訊中並看不出是什麼原因導致的報錯,我們可以到報警日誌檔案中檢視有價值的線索。
其中,黃色標註部分為關鍵資訊,我們知道“/u01/app/oracle/oradata/HOEGH/redo01.log”這個檔案找不到了。
其中,
點選(此處)摺疊或開啟
-
[oracle@enmoedu1 trace]$ tail -40 alert_HOEGH.log
-
-
Wed Jul 08 21:59:30 2015
-
-
MMON started with pid=15, OS id=5443
-
-
Wed Jul 08 21:59:30 2015
-
-
MMNL started with pid=16, OS id=5445
-
-
starting up 1 dispatcher(s) for network address \'(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))\'...
-
-
starting up 1 shared server(s) ...
-
-
ORACLE_BASE from environment = /u01/app/oracle
-
-
Wed Jul 08 21:59:39 2015
-
-
alter database mount
-
-
Wed Jul 08 21:59:43 2015
-
-
Successful mount of redo thread 1, with mount id 2105928075
-
-
Database mounted in Exclusive Mode
-
-
Lost write protection disabled
-
-
Completed: alter database mount
-
-
Wed Jul 08 22:11:45 2015
-
-
Time drift detected. Please check VKTM trace file for more details.
-
-
Wed Jul 08 22:11:59 2015
-
-
alter database open
-
-
Wed Jul 08 22:11:59 2015
-
-
Errors in file /u01/app/oracle/diag/rdbms/HOEGH/HOEGH/trace/HOEGH_lgwr_5435.trc:
-
-
ORA-00313: open failed for members of log group 1 of thread 1
-
-
ORA-00312: online log 1 thread 1: \'/u01/app/oracle/oradata/HOEGH/redo01.log\'
-
-
ORA-27037: unable to obtain file status
-
-
Linux Error: 2: No such file or directory
-
-
Additional information: 3
-
-
Errors in file /u01/app/oracle/diag/rdbms/HOEGH/HOEGH/trace/HOEGH_lgwr_5435.trc:
-
-
ORA-00313: open failed for members of log group 1 of thread 1
-
-
ORA-00312: online log 1 thread 1: \'/u01/app/oracle/oradata/HOEGH/redo01.log\'
-
-
ORA-27037: unable to obtain file status
-
-
Linux Error: 2: No such file or directory
-
-
Additional information: 3
-
-
Errors in file /u01/app/oracle/diag/rdbms/HOEGH/HOEGH/trace/HOEGH_ora_5451.trc:
-
-
ORA-00313: open failed for members of log group 1 of thread
-
-
ORA-00312: online log 1 thread 1: \'/u01/app/oracle/oradata/HOEGH/redo01.log\'
-
-
USER (ospid: 5451): terminating the instance due to error 313
-
-
Wed Jul 08 22:12:00 2015
-
-
System state dump requested by (instance=1, osid=5451), summary=[abnormal instance termination].
-
-
System State dumped to trace file /u01/app/oracle/diag/rdbms/HOEGH/HOEGH/trace/HOEGH_diag_5425.trc
-
-
Dumping diagnostic data in directory=[cdmp_20150708221200], requested by (instance=1, osid=5451), summary=[abnormal instance termination].
-
- Instance terminated by USER, pid = 5451
4.啟動資料庫到mount狀態,重建重做日誌檔案組
從報警日誌可以看出,第一組重做日誌檔案組丟了,我們可以透過sql語句“alter database clear logfile group 1;”重建日誌檔案組;確認日誌檔案建立成功後,將資料庫切換到open狀態。
此時我們再次檢視檔案列表,結果如下。
為了確保新建的日誌檔案組可用,我們可以手動切換日誌檔案組,改變新建日誌檔案組的狀態(由UNUSED改為其他)。點選(此處)摺疊或開啟
-
SQL> startup nomount
-
-
ORACLE instance started.
-
-
-
-
Total System Global Area 941600768 bytes
-
-
Fixed Size 1348860 bytes
-
-
Variable Size 515902212 bytes
-
-
Database Buffers 419430400 bytes
-
-
Redo Buffers 4919296 bytes
-
-
SQL> alter database mount;
-
-
-
-
Database altered.
-
-
-
-
SQL> select group#,sequence#,archived,status from v$log;
-
-
-
-
GROUP# SEQUENCE# ARC STATUS
-
-
---------- ---------- --- ----------------
-
-
1 7 NO INACTIVE
-
-
3 6 NO INACTIVE
-
-
2 8 NO CURRENT
-
-
-
-
SQL>
-
-
SQL>
-
-
SQL>
-
-
SQL>
-
-
SQL> alter database clear logfile group 1;
-
-
-
-
Database altered.
-
-
-
-
SQL> select group#,sequence#,archived,status from v$log;
-
-
-
-
GROUP# SEQUENCE# ARC STATUS
-
-
---------- ---------- --- ----------------
-
-
1 0 NO UNUSED
-
-
3 6 NO INACTIVE
-
-
2 8 NO CURRENT
-
-
-
-
-
-
啟動資料庫到open狀態
-
-
SQL>
-
-
SQL> alter database open;
-
-
-
-
Database altered.
-
-
-
-
SQL>
-
-
SQL> select group#,sequence#,archived,status from v$log;
-
-
-
-
GROUP# SEQUENCE# ARC STATUS
-
-
---------- ---------- --- ----------------
-
-
1 0 NO UNUSED
-
-
2 8 NO CURRENT
-
- 3 6 NO INACTIVE
點選(此處)摺疊或開啟
-
[oracle@hoegh HOEGH]$ ls
-
-
control01.ctl control02.ctl example01.dbf redo01.log redo02.log redo03.log sysaux01.dbf system01.dbf temp01.dbf undotbs01.dbf users01.dbf
-
- [oracle@hoegh HOEGH]$
5.手動切換重做日誌檔案組
點選(此處)摺疊或開啟
-
SQL>
-
-
SQL> alter system switch logfile;
-
-
-
-
System altered.
-
-
-
-
SQL> select group#,sequence#,archived,status from v$log;
-
-
-
-
GROUP# SEQUENCE# ARC STATUS
-
-
---------- ---------- --- ----------------
-
-
1 9 NO CURRENT
-
-
2 8 NO ACTIVE
-
-
3 6 NO INACTIVE
-
-
-
-
SQL> alter system switch logfile;
-
-
-
-
System altered.
-
-
-
-
SQL> select group#,sequence#,archived,status from v$log;
-
-
-
-
GROUP# SEQUENCE# ARC STATUS
-
-
---------- ---------- --- ----------------
-
-
1 9 NO ACTIVE
-
-
2 8 NO ACTIVE
-
-
3 10 NO CURRENT
-
-
-
-
SQL> alter system switch logfile;
-
-
-
-
System altered.
-
-
-
-
SQL> select group#,sequence#,archived,status from v$log;
-
-
-
-
GROUP# SEQUENCE# ARC STATUS
-
-
---------- ---------- --- ----------------
-
-
1 9 NO INACTIVE
-
-
2 11 NO CURRENT
-
-
3 10 NO INACTIVE
-
-
-
- SQL>
current:表示該日誌組為當前日誌組,oracle正在使用該日誌組;
active:當current redo組發生日誌切換時,狀態會改變為active,在這個狀態下,如果為歸檔模式,archive程式會歸檔active日誌組;如果發生資料庫crash,該日誌組也是例項恢復必需的日誌組;
inactive:當active日誌組歸檔完畢並且oracle判斷不需要進行例項恢復時,會將其狀態修改為inactive,等待下一輪的使用;所以當日志組為inactive的時候,如果資料庫為歸檔模式.那麼日誌肯定是歸檔完成了。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/30162081/viewspace-1727538/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle11g redo log 建立、新增、刪除(重做日誌組,重做日誌檔案)Oracle
- MySQL資料庫中的日誌檔案---(1)錯誤日誌MySql資料庫
- oracle歸檔日誌滿了,導致無法啟動 ORA-03113Oracle
- 誤刪歸檔日誌除導致備份歸檔日誌失敗
- Sybase資料庫日誌過大導致不能啟動(轉)資料庫
- data guard中增加與刪除主備資料庫中的聯機重做日誌與備重做日誌檔案資料庫
- 【REDO】刪除REDO LOG重做日誌組後需要手工刪除對應的日誌檔案
- 【REDO】刪除聯機重做日誌檔案組的注意事項
- asm磁碟組依賴導致資料庫自啟動報錯ASM資料庫
- ORACLE for windows 審計檔案xml檔案過多導致資料庫啟動報錯ORA-09925OracleWindowsXML資料庫
- 16、重做日誌檔案的狀態及重做日誌組的狀態說明
- 刪除重做日誌檔案組的四大限制條件
- pg 資料庫日誌檔案誤刪除後的應對方案資料庫
- 刪除日誌檔案組與日誌檔案成員
- 歸檔日誌無法歸檔導致資料庫hang住資料庫
- 手工刪除歸檔日誌導致RMAN備份時報ORA-19625錯誤
- 歸檔日誌滿導致ORA-13516錯誤,awr報表不能自動收集
- 【REDO】刪除聯機重做日誌檔案組成員的注意事項
- SPFILE 錯誤導致資料庫無法啟動(ORA-01565)資料庫
- 丟失當前current重做日誌檔案下恢復資料庫資料庫
- Oracle資料庫重做日誌及歸檔日誌的工作原理說明Oracle資料庫
- 刪除redo所有日誌,資料庫無法啟動資料庫
- oracle資料庫移動資料檔案、日誌檔案和控制檔案Oracle資料庫
- OGG-00685 goldengate 啟動報錯 (日誌沒有切換形成歸檔導致)Go
- 又一例SPFILE設定錯誤導致資料庫無法啟動資料庫
- 建立資料庫檔案-日誌檔案-次要資料庫檔案資料庫
- 達夢資料庫DM8之REDOLOG重做日誌檔案管理資料庫
- 聯機重做日誌、歸檔日誌、備用重做日誌
- Oracle重做日誌檔案基礎Oracle
- oracle 聯機重做日誌檔案Oracle
- 重做日誌檔案中的SCN
- 當丟失控制檔案但重做日誌檔案還在時如何恢復資料庫資料庫
- 歸檔日誌滿導致的資料庫掛起故障處理資料庫
- 一個刪除重做日誌檔案的參考指令碼指令碼
- 為oracle新增重做日誌組及重做日誌成員Oracle
- 【故障處理】手工刪除歸檔日誌導致RMAN備份時報ORA-19625錯誤
- 刪除日誌檔案組或成員
- Oracle10g中的flashback啟用日誌歸檔,寫滿空間導致錯誤Oracle