Clearing redo logfile in oracle database.

Sometimes redo log file become corrupted while database open the database may "lock up" and we are unable to do anything because archiving can't continue this case you may execute 'ALTER DATABASE CLEAR LOGFILE' statement to reinitialize the redo log file and database continue processing.


SQL> select GROUP#,SEQUENCE#,MEMBERS,ARCHIVED,STATUS from v$log;

    GROUP#  SEQUENCE#    MEMBERS ARC STATUS
---------- ---------- ---------- --- ----------------
         3      69151          2 YES UNUSED
         5      69150          2 YES INACTIVE
         4      69152          2 NO  CURRENT



Note:- Specifying UNARCHIVED makes backups unusable if the redo log is needed for recovery. Do not use CLEAR LOGFILE to clear a log needed for media recovery.

If the corrupted redo log file has not been archived, use the unarchived keywordin the alter database clear logfile statemnent.


SQL> ALTER DATABASE CLEAR UNARCHIVED LOGFILE GROUP 5;


The unarchived option clears the corrupt online redo log and avoids archiving it.



No comments:

Post a Comment

Thanks for reading till end. I hope this will help you more to improve your knowledge.

Now it's your turn!

What do you think? Share your experience in the comments box and subscribe for more interesting post.