Professional Documents
Culture Documents
Oracle Database Backup and Recovery Advanced User's Guide 10g Release 2 (10.2) Home Book Contents Index Master Contact Part Number B14191-02 List Index Us
View PDF
Previous Next
C U R R E N T
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.
A C T I V E
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.
C L E A R I N G
The log is being re-created as an empty log after an A L T E RD A T A B A S EC L E A RL O G F I L E statement. After the log is cleared, then the status changes to U N U S E D .
C L E A R I N G _ C U R R E N T The current log is being cleared of a closed thread. The log can stay in this status if there is some failure in the switch such as an I/O error writing the new log header.
I N A C T I V E
The log is no longer needed for instance recovery. It may be in use for media recovery, and may or may not be archived.
http://www.di.unipi.it/~ghelli/didattica/bdldoc/B19306_01/backup.102/b14191/recoscen008.htm
1/6
2/20/2014
If the hardware problem is temporary, then correct it. The log writer process accesses the previously unavailable online redo log files as if the problem never existed. If the hardware problem is permanent, then drop the damaged member and add a new member by using the following procedure. Note: The newly added member provides no redundancy until the log group is reused. 1. Locate the filename of the damaged member in V $ L O G F I L E . The status is I N V A L I Dif the file is inaccessible: S E L E C TG R O U P # ,S T A T U S ,M E M B E R F R O MV $ L O G F I L E W H E R ES T A T U S = ' I N V A L I D ' ; G R O U P # 0 0 0 2 S T A T U S M E M B E R - I N V A L I D / o r a c l e / o r a d a t a / t r g t / r e d o 0 2 . l o g
2. Drop the damaged member. For example, to drop member r e d o 0 1 . l o gfrom group 2 , issue: A L T E RD A T A B A S ED R O PL O G F I L EM E M B E R' / o r a c l e / o r a d a t a / t r g t / r e d o 0 2 . l o g ' ; 3. Add a new member to the group. For example, to add r e d o 0 2 . l o gto group 2 , issue: A L T E RD A T A B A S EA D DL O G F I L EM E M B E R' / o r a c l e / o r a d a t a / t r g t / r e d o 0 2 b . l o g ' T OG R O U P2 ; If the file you want to add already exists, then it must be the same size as the other group members, and you must specify R E U S E . For example: A L T E RD A T A B A S EA D DL O G F I L EM E M B E R' / o r a c l e / o r a d a t a / t r g t / r e d o 0 2 b . l o g ' R E U S ET OG R O U P2 ;
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, 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, then it is needed for crash recovery; otherwise, it is not.
If the group is ... Then . . . Inactive Active Current
It is not needed for crash Clear the archived or unarchived group. recovery It is needed for crash recovery It is the log that the database is currently writing to Attempt to issue a checkpoint and clear the log; if impossible, then you must restore a backup and perform incomplete recovery up to the most recent available redo log. Attempt to clear the log; if impossible, then you must restore a backup and perform incomplete recovery up to the most recent available redo log.
2/6
http://www.di.unipi.it/~ghelli/didattica/bdldoc/B19306_01/backup.102/b14191/recoscen008.htm
2/20/2014
writing to
Your first task is to determine whether the damaged group is active or inactive. 1. Locate the filename of the lost redo log in V $ L O G F I L Eand then look for the group number corresponding to it. For example, enter: S E L E C TG R O U P # ,S T A T U S ,M E M B E RF R O MV $ L O G F I L E ; G R O U P # 0 0 0 1 0 0 0 1 0 0 0 2 0 0 0 2 0 0 0 3 0 0 0 3 S T A T U S M E M B E R - / o r a c l e / d b s / l o g 1 a . f / o r a c l e / d b s / l o g 1 b . f I N V A L I D / o r a c l e / d b s / l o g 2 a . f I N V A L I D / o r a c l e / d b s / l o g 2 b . f / o r a c l e / d b s / l o g 3 a . f / o r a c l e / d b s / l o g 3 b . f
3. If the affected group is inactive, follow the procedure in Losing an Inactive Online Redo Log Group. If the affected group is active (as in the preceding example), then follow the procedure in "Losing an Active Online Redo Log Group".
Clearing Inactive, Archived Redo You can clear an inactive redo log group when the database is open or closed. The procedure depends on whether the damaged group has been archived.
http://www.di.unipi.it/~ghelli/didattica/bdldoc/B19306_01/backup.102/b14191/recoscen008.htm 3/6
2/20/2014
To clear an inactive, online redo log group that has been archived, use the following procedure: 1. If the database is shut down, then start a new instance and mount the database: S T A R T U PM O U N T 2. Reinitialize the damaged log group. For example, to clear redo log group 2 , issue the following statement: A L T E RD A T A B A S EC L E A RL O G F I L EG R O U P2 ; Clearing Inactive, Not-Yet-Archived Redo Clearing a not-yet-archived redo log allows it to be reused without archiving it. This action makes backups unusable if they were started before the last change in the log, unless the file was taken offline prior to the first change in the log. Hence, if you need the cleared log file for recovery of a backup, then you cannot recover that backup. Also, it prevents complete recovery from backups due to the missing log. To clear an inactive, online redo log group that has not been archived, use the following procedure: 1. If the database is shut down, then start a new instance and mount the database: S T A R T U PM O U N T 2. Clear the log using the U N A R C H I V E Dkeyword. For example, to clear log group 2 , issue: A L T E RD A T A B A S EC L E A RL O G F I L EU N A R C H I V E DG R O U P2 ; If there is an offline datafile that requires the cleared log to bring it online, then the keywords U N R E C O V E R A B L E D A T A F I L Eare required. The datafile and its entire tablespace have to be dropped because the redo necessary to bring it online is being cleared, and there is no copy of it. For example, enter: A L T E RD A T A B A S EC L E A RL O G F I L EU N A R C H I V E DG R O U P2U N R E C O V E R A B L ED A T A F I L E ; 3. Immediately back up the whole database with an operating system utility, so that you have a backup you can use for complete recovery without relying on the cleared log group. For example, enter: %c p/ d i s k 1 / o r a c l e / d b s / * . f/ d i s k 2 / b a c k u p 4. Back up the database's control file with the A L T E RD A T A B A S Estatement. For example, enter: A L T E RD A T A B A S EB A C K U PC O N T R O L F I L ET O' / o r a c l e / d b s / c f _ b a c k u p . f ' ; Failure of CLEAR LOGFILE Operation The A L T E RD A T A B A S EC L E A RL O G F I L Estatement 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, due to media failure)
http://www.di.unipi.it/~ghelli/didattica/bdldoc/B19306_01/backup.102/b14191/recoscen008.htm 4/6
2/20/2014
In these cases, the A L T E RD A T A B A S EC L E A RL O G F I L Estatement (before receiving the I/O error) would have successfully informed the control file that the log was being cleared and did not require archiving. The I/O error occurred at the step in which the C L E A RL O G F I L Estatement attempts to create the new redo log file and write zeros to it. This fact is reflected in V $ L O G . C L E A R I N G _ C U R R E N T .
2/20/2014
2. Ensure that the current name of the lost redo log can be used for a newly created file. If not, then rename the members of the damaged online redo log group to a new location. For example, enter: A L T E RD A T A B A S ER E N A M EF I L E" ? / o r a d a t a / t r g t / r e d o 0 1 . l o g "T O" / t m p / r e d o 0 1 . l o g " ; A L T E RD A T A B A S ER E N A M EF I L E" ? / o r a d a t a / t r g t / r e d o 0 1 . l o g "T O" / t m p / r e d o 0 2 . l o g " ; 3. Open the database using the R E S E T L O G Soption: A L T E RD A T A B A S EO P E NR E S E T L O G S ; Note: All updates executed from the endpoint of the incomplete recovery to the present must be re-executed.
Previous Next
http://www.di.unipi.it/~ghelli/didattica/bdldoc/B19306_01/backup.102/b14191/recoscen008.htm
6/6