Database Reference
In-Depth Information
Next, ensure that your database is in mount mode:
$ sqlplus / as sysdba
SQL> startup mount;
Next, run the following query to verify that the damaged log group is INACTIVE and determine whether it has
been archived:
SELECT group#, status, archived, thread#, sequence#
FROM v$log;
Here is some sample output:
GROUP# STATUS ARC THREAD# SEQUENCE#
---------- ---------------- --- ---------- ----------
1 CURRENT NO 1 25
3 INACTIVE NO 1 24
2 INACTIVE NO 1 23
If the status is INACTIVE , then this log group is no longer needed for crash recovery (as described in Table 7-3 ).
Therefore, you can use the clear logfile command to re-create all members of a log group. The following example
re-creates all log members of group 2:
SQL> alter database clear logfile group 2;
If the log group has not been archived, then you will need to use the clear unarchived logfile command as
follows:
SQL> alter database clear unarchived logfile group 2;
If the cleared log group had not been previously archived, it's critical that you immediately create a backup of
your database. See Chapter 5 for details on taking a complete backup of your database.
Keep in mind that in these prior examples the logfile group is number 2. You'll have to modify the group number
to match the group number for your scenario.
If the online redo log group is inactive and archived, then its contents aren't required for crash or media recovery.
Therefore it's possible to use the clear logfile command to re-create all online redo log file members of a group.
the clear logfile command will drop and re-create all members of a log group for you. You can issue this
command even if you have only two log groups in your database.
Note
If the online redo log group has not been archived, then it may be required for media recovery. In this case, use
the clear unarchived logfile command to re-create the logfile group members. Back up your database as soon as
possible in this situation.
The unarchived log group may be needed for media recovery if the last database backups were taken before the
redo information in the log was created. This means if you attempt to perform media recovery, you won't be able to
recover any information in the damaged log file or any transactions that were created after that log.
If the clear logfile command does not succeed because of an I/O error and it's a permanent problem, then you
will need to consider dropping the log group and re-creating it in a different location. See the next two subsections for
directions on how to drop and re-create a log file group.
 
 
Search WWH ::




Custom Search