Oracle® Database Backup and Recovery Advanced User's Guide 10g Release 2 (10.

2) Part Number B14191-02

Home Book ContentsIndex Master Contact List Index Us View PDF

Previous Next

Recovering After the Loss of Online Redo Log Files: Scenarios
If a media failure has affected the online redo logs of a database, then the appropriate recovery procedure depends on the following:
  

The configuration of the online redo log: mirrored or non-mirrored The type of media failure: temporary or permanent The types of online redo log files affected by the media failure: current, active, unarchived, or inactive

Table 19-1 displays V$LOG status information that can be crucial in a recovery situation involving online redo logs. Table 19-1 STATUS Column of V$LOG Status
UNUSED CURRENT

Description The online redo log has never been written to. The online redo log is active, that is, needed for instance recovery, and it is the log to which the database is currently writing. The redo log can be open or closed. The online redo log is active, that is, needed for instance recovery, but is not the log to which the database is currently writing.It may be in use for block recovery, and may or may not be archived. The log is being re-created as an empty log after an ALTER DATABASE CLEAR LOGFILE statement. After the log is cleared, then the status changes to UNUSED. status if there is some failure in the switch such as an I/O error writing the new log header.

ACTIVE

CLEARING

CLEARING_CURRENT The current log is being cleared of a closed thread. The log can stay in this

INACTIVE

The log is no longer needed for instance recovery. It may be in use for media recovery, and may or may not be archived.

issue: 11.log' 15. If the hardware problem is permanent. then the database continues functioning as normal. Add a new member to the group. 4. 12.log of the database. Locate the filename of the damaged member in V$LOGFILE.Recovering After Losing a Member of a Multiplexed Online Redo Log Group If the online redo log of a database is multiplexed. Drop the damaged member. ALTER DATABASE ADD LOGFILE MEMBER '/oracle/oradata/trgt/redo02b. 5. 7. MEMBER FROM V$LOGFILE WHERE STATUS='INVALID'.log 10.log from group 2. 13. For example. The status is INVALID if the file is inaccessible: 2. then correct it. SELECT GROUP#. If the file you want to add already exists. 3.log to group 2. 1. For example. 6.log' REUSE TO GROUP 2. The log writer process accesses the previously unavailable online redo log files as if the problem never existed. 16. but error messages are written to the log writer trace file and the alert_SID. to drop member redo01. Solve the problem by taking one of the following actions:   If the hardware problem is temporary. STATUS. to add redo02. 8. issue: 14. GROUP# ------0002 STATUS ----------INVALID MEMBER --------------------/oracle/oradata/trgt/redo02. and you must specify REUSE. then it must be the same size as the other group members. 9. and if at least one member of each online redo log group is not affected by the media failure. ALTER DATABASE DROP LOGFILE MEMBER '/oracle/oradata/trgt/redo02. For example: ALTER DATABASE ADD LOGFILE MEMBER '/oracle/oradata/trgt/redo02b. then drop the damaged member and add a new member by using the following procedure. TO GROUP 2. Note: The newly added member provides no redundancy until the log group is reused. .log'.

. 0003 /oracle/dbs/log3a. 18. 16. Clear the archived or unarchived group. Attempt to clear the log. if impossible. 3. otherwise. 19. . Inactive Active It is not needed for crash recovery It is needed for crash recovery And you should . MEMBER FROM V$LOGFILE. 0003 /oracle/dbs/log3b. then you must restore a backup and perform incomplete recovery up to the most recent available redo log. GROUP# STATUS MEMBER 5. 0001 /oracle/dbs/log1a. STATUS.f 11. 0002 INVALID /oracle/dbs/log2a. then you must restore a backup and perform incomplete recovery up to the most recent available redo log. Current It is the log that the database is currently writing to Your first task is to determine whether the damaged group is active or inactive. For example. . 20.f 8. STATUS. enter: 2. 21. 17. enter: 14.f 10. GROUP# -----0001 0002 0003 MEMBERS ------2 2 2 STATUS --------INACTIVE ACTIVE CURRENT ARCHIVED ----------YES NO NO . SELECT GROUP#. 1. Determine which groups are active. ARCHIVED FROM V$LOG. 13.f 12. Attempt to issue a checkpoint and clear the log. 0001 /oracle/dbs/log1b.f 7. . 4. it is not. . 0002 INVALID /oracle/dbs/log2b. MEMBERS.Recovering After the Loss of All Members of an Online Redo Log Group If a media failure damages all members of an online redo log group. Locate the filename of the lost redo log in V$LOGFILE and then look for the group number corresponding to it. if impossible. Then . then different scenarios can occur depending on the type of online redo log group affected by the failure and the archiving mode of the database. If the damaged log group is active. 15. . If the group is . SELECT GROUP#. For example. then it is needed for crash recovery.--------------------6.f 9. ----------------.

LGWR can reuse the redo log group when required. Clearing Inactive. then start a new instance and mount the database: 2. it prevents complete recovery from backups due to the missing log. Archived Redo You can clear an inactive redo log group when the database is open or closed. online redo log group that has been archived. If the database is shut down. If the failure is . use the following procedure: 1. unless the file was taken offline prior to the first change in the log. For example. . . . Then . Losing an Inactive Online Redo Log Group If all members of an online redo log group with INACTIVE status are damaged. then the procedure depends on whether you can fix the media problem that damaged the inactive redo log group. Hence. ALTER DATABASE CLEAR LOGFILE GROUP 2. The damaged inactive online redo log group eventually halts normal database operation. Clearing Inactive. then you cannot recover that backup.22. 23. 4. To clear an inactive. Reinitialize the damaged log group. then start a new instance and mount the database: 2. issue the following statement: 5. STARTUP MOUNT . if you need the cleared log file for recovery of a backup. online redo log group that has not been archived. To clear an inactive. Not-Yet-Archived Redo Clearing a not-yet-archived redo log allows it to be reused without archiving it. Temporary Permanent Fix the problem. If the database is shut down. Also. If the affected group is active (as in the preceding example). If the affected group is inactive. Reinitialize the damaged group manually by issuing the ALTER DATABASE CLEAR LOGFILE statement as described in this section. follow the procedure in Losing an Inactive Online Redo Log Group. STARTUP MOUNT 3. then follow the procedure in "Losing an Active Online Redo Log Group". to clear redo log group 2. use the following procedure: 1. . This action makes backups unusable if they were started before the last change in the log. The procedure depends on whether the damaged group has been archived.

and you can follow the procedure in "Losing an Inactive Online Redo Log Group". ALTER DATABASE BACKUP CONTROLFILE TO '/oracle/dbs/cf_backup. 10. Immediately back up the whole database with an operating system utility. 4. The I/O error occurred at the step in which the CLEAR LOGFILE statement attempts to create the new redo log file and write zeros to it. or if your database has halted.CLEARING_CURRENT. If unsuccessful. Clear the log using the UNARCHIVED keyword. % cp /disk1/oracle/dbs/*.3.f'. 6. The datafile and its entire tablespace have to be dropped because the redo necessary to bring it online is being cleared. depending on the archiving mode. Losing an Active Online Redo Log Group If the database is still running and the lost active redo log is not the current log. then the keywords UNRECOVERABLE DATAFILE are required. enter: 11. For example. enter: 8. If successful. For example. due to media failure) In these cases. enter: ALTER DATABASE CLEAR LOGFILE UNARCHIVED GROUP 2 UNRECOVERABLE DATAFILE. and there is no copy of it. issue: 5. then the active redo log becomes inactive. the ALTER DATABASE CLEAR LOGFILE statement (before receiving the I/O error) would have successfully informed the control file that the log was being cleared and did not require archiving. Back up the database's control file with the ALTER DATABASE statement. For example. ALTER DATABASE CLEAR LOGFILE UNARCHIVED GROUP 2. Failure of CLEAR LOGFILE Operation The ALTER DATABASE CLEAR LOGFILE statement can fail with an I/O error due to media failure when it is not possible to:   Relocate the redo log file onto alternative media by re-creating it under the currently configured redo log filename Reuse the currently configured log filename to re-create the redo log file because the name itself is invalid or unusable (for example. This fact is reflected in V$LOG. If there is an offline datafile that requires the cleared log to bring it online. so that you have a backup you can use for complete recovery without relying on the cleared log group. then issue the ALTER SYSTEM CHECKPOINT statement.f /disk2/backup 9. then perform one of procedures in this section. to clear log group 2. . For example. 7.

perform incomplete recovery. Open the database using the RESETLOGS option: 13. then correct the problem so that the database can reuse the group when required. If a LGWR I/O fails. SHUTDOWN IMMEDIATE 17. To recover from loss of an active online log group in NOARCHIVELOG mode: 1. 1. Restore the database from a consistent. If not. 5. you must first mimic incomplete recovery: 9. % cp /disk2/backup/*. ALTER DATABASE RENAME FILE "?/oradata/trgt/redo01.log". If the media failure is not temporary. 6. enter: 3. In order to allow the database to reset the online redo logs. For example. In this case. then correct the problem so that the database can reuse the group when required. then LGWR terminates and the instance crashes. and open the database with the RESETLOGS option. RECOVER DATABASE UNTIL CANCEL 10. Because online redo logs are not backed up. To recover from loss of an active online redo log group in ARCHIVELOG mode: If the media failure is temporary. 5.dbf $ORACLE_HOME/oradata/trgt/ 4. . then use the following procedure. 8.The current log is the one LGWR is currently writing to. If the media failure is temporary. 2. recovering up through the log before the damaged log. 4. Begin incomplete media recovery. CANCEL 11. 14. STARTUP MOUNT 7. then rename the members of the damaged online redo log group to a new location. ALTER DATABASE OPEN RESETLOGS. For example. Shut down the database consistently. Make a whole database backup. 18. For example.log". 15. 2. enter: 16. you cannot restore them with the datafiles and control files. you must restore a backup.log" TO "/tmp/redo01. enter: 3.log" TO "/tmp/redo02. 12. ALTER DATABASE RENAME FILE "?/oradata/trgt/redo01. Open the database using the RESETLOGS option: 7. Ensure that the current name of the lost redo log can be used for a newly created file. Mount the database: 6. whole database backup (datafiles and control files) as described in "Restoring Datafiles Before Performing Incomplete Recovery". ALTER DATABASE OPEN RESETLOGS.

then use the recovery method for the most difficult log to recover. 4. Home Book ContentsIndex Master Contact 2005. List Index Us . 3.Note: All updates executed from the endpoint of the incomplete recovery to the present must be re-executed. All rights reserved. Oracle. from most difficult to least difficult. The order of difficulty. 2. follows: 1. Loss of Multiple Redo Log Groups If you have lost multiple groups of the online redo log. The current online redo log An active online redo log An unarchived online redo log An inactive online redo log Previous Next Copyright © 2003.

Sign up to vote on this title
UsefulNot useful