Thanks very much for the respose.
Quoting from your previous comment "If an online redo log file has been corrupted while the database is open, the 'alter
database clear logfile' command can be used to clear the files without the database having to be shut down."
As the purpose of clear logfile is to fix "corrupted/damaged" redo log group without having to shutdown database, I continue to do more testing to ensure I understand the use of clear logfile command:
Test Case 2: Repair the corrupted online redo log group that's archived and inactive
1. Targetting group 1 in this test case
SQL> SELECT GROUP#, MEMBERS, STATUS, ARCHIVED FROM V$LOG;
GROUP# MEMBERS STATUS ARC
---------- ---------- ---------------- ---
1 2 INACTIVE YES
2 2 CURRENT NO
3 2 INACTIVE YES
SQL> SELECT GROUP#, STATUS, MEMBER FROM V$LOGFILE;
GROUP# STATUS MEMBER
---------- ------- ------------------------------------------------------------
1 /u01/oradata/SOLODBA/redoSOLODBA01a.log
1 /u01/oradata/SOLODBA/redoSOLODBA01b.log
2 /u01/oradata/SOLODBA/redoSOLODBA02a.log
2 /u01/oradata/SOLODBA/redoSOLODBA02b.log
3 /u01/oradata/SOLODBA/redoSOLODBA03a.log
3 /u01/oradata/SOLODBA/redoSOLODBA03b.log
2. corrupt all members of redo group1 (/u01/oradata/SOLODBA/redoSOLODBA01a.log & /u01/oradata/SOLODBA/redoSOLODBA01b.log) by using vi to add a few characters
3. use clear logfile to fix damaged redo log file as according to oracle doc (Clearing Inactive, Archived Redo) --
http://download-west.oracle.com/docs/cd/B19306_01/backup.102/b14191/recoscen008.htm#sthref1906 SQL> ALTER DATABASE CLEAR LOGFILE GROUP 1;
Database altered.
4.
SQL> SELECT GROUP#, MEMBERS, STATUS, ARCHIVED FROM V$LOG;
GROUP# MEMBERS STATUS ARC
---------- ---------- ---------------- ---
1 2 UNUSED YES
2 2 CURRENT NO
3 2 INACTIVE YES
SQL> alter system switch logfile;
System altered.
SQL> SELECT GROUP#, MEMBERS, STATUS, ARCHIVED FROM V$LOG;
GROUP# MEMBERS STATUS ARC
---------- ---------- ---------------- ---
1 2 CURRENT NO
2 2 ACTIVE YES
3 2 INACTIVE YES
SQL> alter system switch logfile;
at this point, I start seeing the following errors in the alert log:
=====================================================================
Completed: ALTER DATABASE CLEAR LOGFILE GROUP 1
Fri Jun 8 14:56:36 2007
Thread 1 advanced to log sequence 5
Current log# 1 seq# 5 mem# 0: /u01/oradata/SOLODBA/redoSOLODBA01a.log
Current log# 1 seq# 5 mem# 1: /u01/oradata/SOLODBA/redoSOLODBA01b.log
Fri Jun 8 14:57:03 2007
Thread 1 advanced to log sequence 6
Current log# 3 seq# 6 mem# 0: /u01/oradata/SOLODBA/redoSOLODBA03a.log
Current log# 3 seq# 6 mem# 1: /u01/oradata/SOLODBA/redoSOLODBA03b.log
Fri Jun 8 14:57:03 2007
Errors in file /opt/oracle/admin/SOLODBA/bdump/solodba_arc0_13023.trc:
ORA-00314: log 1 of thread 1, expected sequence# 5 doesn't match 0
ORA-00312: online log 1 thread 1: '/u01/oradata/SOLODBA/redoSOLODBA01b.log'
ORA-00314: log 1 of thread 1, expected sequence# 5 doesn't match 0
ORA-00312: online log 1 thread 1: '/u01/oradata/SOLODBA/redoSOLODBA01a.log'
Fri Jun 8 14:57:03 2007
Errors in file /opt/oracle/admin/SOLODBA/bdump/solodba_arc0_13023.trc:
ORA-00314: log 1 of thread 1, expected sequence# 5 doesn't match 0
ORA-00312: online log 1 thread 1: '/u01/oradata/SOLODBA/redoSOLODBA01b.log'
ORA-00314: log 1 of thread 1, expected sequence# 5 doesn't match 0
ORA-00312: online log 1 thread 1: '/u01/oradata/SOLODBA/redoSOLODBA01a.log'
Fri Jun 8 14:57:03 2007
ARC0: Failed to archive thread 1 sequence 5 (0)
ARCH: Archival stopped, error occurred. Will continue retrying
Fri Jun 8 14:57:03 2007
ORACLE Instance SOLODBA - Archival Error
Fri Jun 8 14:57:03 2007
ORA-16038: log 1 sequence# 5 cannot be archived
ORA-00312: online log 1 thread 1: '/u01/oradata/SOLODBA/redoSOLODBA01a.log'
ORA-00312: online log 1 thread 1: '/u01/oradata/SOLODBA/redoSOLODBA01b.log'
=====================================================================
At the end, I had to drop the log group to resolve the above siuation.
I don't think it's correct that I am getting the above error messages after clear logfile -- although drop logfile is okay at this case since the logfile group is archived.
Could you please demostrate the correct use of clear log file (ALTER DATABASE CLEAR LOGFILE UNARCHIVED GROUP <group number> and ALTER DATABASE CLEAR LOGFILE GROUP <group number>) if possible as you can see I didn't any luck from the above two test cases including the one in the post? thanks heaps.
So am I correct by saying the following:
- inactive archived redo group:
drop damaged or missing log files to resolve the issue (provided we have more than two redo groups)
or use clear logfile -- look forward to see your example :)
- inactive unarchived redo group:
have to use clear logfile unarchived to resolve the issue -- look forward to see your example :)
Thanks for your help in advance,
Aimee