|Lesson 4||Clearing corrupt Online Redo Log Files|
|Objective||Describe the Application of Syntax to clear Redo Log Files|
In most situations, the corrupt online redo log files can be recovered by issuing the
ALTER DATABASE CLEAR LOGFILE GROUP <group_number>;
command with the options
View the SlideShow below to examine the steps to clear damaged online redo log files.
Steps to Clear Damaged Online RedoLogFiles
ALTER DATABASE CLEAR LOGFILE GROUP command drops the corrupted online redo file and recreates it without shutting down the database.
ALTER DATABASE CLEAR LOGFILE command can be used in several situations. It is applicable even if there are only two online redo log groups
(the minimum needed to keep your database operating). If the corrupt redo log file belongs to the current group, you can still use the command.
However, you can't use the
ALTER DATABASE CLEAR LOGFILE command across the board. If the online redo log file is not archived
before it is cleared with this command, a complete recovery of the database becomes impossible. You can only recover the database up to the time before this damaged online redo log is needed. So, use the command with the
UNARCHIVED option very carefully.
Performing a whole database backup after the command is issued, including the control file, is highly recommended.
You also should not use this command to clear an online redo log file that is required for media ecovery.
Corrupted online redo logs for offline datafiles
If you have an offline datafile and it requires the damaged, unarchived online redo log for recovery,
you can still use the
ALTER DATABASE CLEAR LOGFILE GROUP <grour_number> UNRECOVERABLE DATAFILE;
command to clear the corrupted online redo log file.
Be aware that the offline datafile needing this redo log for recovery becomes unusable after this command is issued.
For this procedure to be successful, you have to drop the datafile and its tablespace from the database. To avoid losing the datafile and its tablespace:
- Bring the offline datafile online
- Restore all the datafiles, and
- Perform an incomplete recovery prior to the corrupted redo log file
Either way, it is strongly recommended that you make a backup of the database in case future recovery is necessary.
The next lesson explains how to recover a database with inactive redo logs.