INACTIVE日誌組損壞的修復

GM_DBA發表於2013-12-04

實驗步驟
1 刪除inactive狀態的日誌檔案;

2 恢復丟失的日誌檔案;

操作如下:
(1) 刪除INACTIVE日誌檔案;
SYS@GMDBA> select group#,thread#,status,archived from v$log; 
GROUP# THREAD# STATUS ARC 
---------- ---------- ---------------- --- 
1 1 ACTIVE NO 
2 1 CURRENT NO 
3 1 INACTIVE YES 
SYS@GMDBA> !rm /u01/app/oracle/oradata/GMDBA/redo03.log 
SYS@GMDBA> shutdown immediate 
Database closed. 
Database dismounted. 
ORACLE instance shut down. 

(2) 重啟後資料庫無法啟動; 
SYS@GMDBA> startup 
ORACLE instance started. 
Total System Global Area 422670336 bytes 
Fixed Size 1345380 bytes 
Variable Size 327157916 bytes 
Database Buffers 88080384 bytes 
Redo Buffers 6086656 bytes 
Database mounted. 
ORA-03113: end-of-file on communication channel 
Process ID: 20087 
Session ID: 125 Serial number: 5 

(3) Alert中報錯說明了日誌檔案丟失; 
ARC1 started with pid=22, OS id=20091 
Errors in file /u01/app/oracle/diag/rdbms/gmdba/GMDBA/trace/GMDBA_lgwr_20050.trc: 
ORA-00313: open failed for members of log group 3 of thread 1 
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/GMDBA/redo03.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/gmdba/GMDBA/trace/GMDBA_lgwr_20050.trc: 
ORA-00313: open failed for members of log group 3 of thread 1 
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/GMDBA/redo03.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/gmdba/GMDBA/trace/GMDBA_ora_20087.trc: 
ORA-00313: open failed for members of log group 1 of thread 
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/GMDBA/redo03.log' 
Tue Dec 03 17:35:21 2013 
ARC2 started with pid=23, OS id=20093 
USER (ospid: 20087): terminating the instance due to error 313 
System state dump requested by (instance=1, osid=20087), summary=[abnormal instance termination]. 
System State dumped to trace file /u01/app/oracle/diag/rdbms/gmdba/GMDBA/trace/GMDBA_diag_20040.trc 
Dumping diagnostic data in directory=[cdmp_20131203173522], requested by (instance=1, osid=20087), summary=[abnormal instance termination]. 
Instance terminated by USER, pid = 20087 

(4) 重建日誌檔案; 

 [oracle@GMDBA dbs]$ sqlplus / as sysdba 
SQL*Plus: Release 11.2.0.3.0 Production on Tue Dec 3 17:35:56 2013 
Copyright (c) 1982, 2011, Oracle. All rights reserved. 
Connected to an idle instance. 
SYS@GMDBA> startup mount 
ORACLE instance started. 
Total System Global Area 422670336 bytes 
Fixed Size 1345380 bytes 
Variable Size 327157916 bytes 
Database Buffers 88080384 bytes 
Redo Buffers 6086656 bytes 
Database mounted. 
SYS@GMDBA> alter database clear logfile group 3; 
Database altered. 
SYS@GMDBA> alter database open; 
Database altered. 
SYS@GMDBA> set lines 200 
SYS@GMDBA> col member for a50 
SYS@GMDBA> select * from v$logfile; 
GROUP# STATUS TYPE MEMBER IS_ 
---------- ------- ------- ------------------------------------------------ 
1 ONLINE /u01/app/oracle/oradata/GMDBA/redo01.log NO 
2 ONLINE /u01/app/oracle/oradata/GMDBA/redo02.log NO 
3 ONLINE /u01/app/oracle/oradata/GMDBA/redo03.log NO 
SYS@GMDBA> 
注:如果日誌組未歸檔,需要使用下面的命令 
SYS@GMDBA> alter database clear logfile group 3; 
alter database clear logfile group 3 

ERROR at line 1: 
ORA-00350: log 3 of instance GMDBA (thread 1) needs to be archived 
ORA-00312: online log 3 thread 1: '/u01/app/oracle/oradata/GMDBA/redo03.log' 


SYS@GMDBA> alter database clear unarchived logfile group 3; 
Database altered. 



來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29319205/viewspace-1062215/,如需轉載,請註明出處,否則將追究法律責任。

相關文章