Redo Logs and Recovery John Hibbard Senior Principal Instructor Minneapolis MN john.hibbard@oracle.com Revised by Dr. Philip Cannata University of Texas, Austin, Texas cannata@cs.utexas.edu
Redo Buffer Operation User #1 UPDATE emp SET sal = 10 WHERE id = 1234 When user enters… User #1 data file 2 undo file 3 data file 4 UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 XYZ Zack database buffer cache
Redo Buffer Operation User #1 UPDATE emp SET sal = 10 WHERE id = 1234 When user enters… User #1 data file 2 undo file 3 data file 4 UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 XYZ Zack The data block is retrieved from disk to the database buffer cache (unless it’s already there) 1234 5 database buffer cache
Redo Buffer Operation User #1 UPDATE emp SET sal = 10 WHERE id = 1234 When user enters… User #1 data file 2 undo file 3 data file 4 UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 XYZ Zack The data block is retrieved from disk to the database buffer cache (unless it’s already there) 1234 5 U1 The undo block is then retrieved from disk to the database buffer cache (unless it’s already there) database buffer cache
Redo Buffer Operation User #1 UPDATE emp SET sal = 10 WHERE id = 1234 When user enters… User #1 data file 2 undo file 3 data file 4 UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 XYZ Zack The data block is retrieved from disk to the database buffer cache (unless it’s already there) 1234 5 U1 The undo block is then retrieved from disk to the database buffer cache (unless it’s already there) 5 The undo data is created showing the ‘before image’ database buffer cache
Redo Buffer Operation Redo Buffer User #1 When user enters… Redo Buffer User #1 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 XYZ Zack T1 3 12 - - 5 The data block is retrieved from disk to the database buffer cache (unless it’s already there) 1234 5 U1 The udo block is then retrieved from disk to the database buffer cache (unless it’s already there) 5 The undo data is created showing the ‘before image’ And an entry recording this change is made in the REDO buffer database buffer cache
Redo Buffer Operation Redo Buffer User #1 When user enters… Redo Buffer User #1 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 XYZ Zack T1 3 12 - - 5 1234 5 Information is also recorded identifying the location of the data segment being changed. U1 5 database buffer cache
Redo Buffer Operation Redo Buffer User #1 When user enters… Redo Buffer User #1 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 XYZ Zack T1 3 12 - - 5 1234 5 Then the data block is changed... x 10 U1 5 database buffer cache
Redo Buffer Operation Redo Buffer User #1 When user enters… Redo Buffer User #1 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 1234 5 Then the data block is changed... x 10 And an entry recording this change is made in the REDO buffer U1 5 database buffer cache
Redo Buffer Operation Redo Buffer User #1 When user enters… Redo Buffer User #1 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 1234 5 Then the data block is changed... x 10 And an entry recording this change is made in the REDO buffer U1 5 database buffer cache
Redo Buffer Operation Keypoint Redo Buffer data file 2 undo file 3 data file 4 Tran File Block Row Column Value id 1234 5 XYZ Zack T1 3 12 - - 5 Keypoint T1 2 123 41 6 10 Transaction identifier Column address Value of the column that changed Only the very basic data is stored in the redo. The main redo items are:
Redo Buffer Operation Redo Buffer This continues for all changes When user enters… Redo Buffer User #1 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 This continues for all changes 1234 5 x 10 User # 2 U1 UPDATE prod SET large_col... WHERE id = XYZ 5 database buffer cache
Redo Buffer Operation Redo Buffer User #1 When user enters… Redo Buffer User #1 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 This continues for all changes 1234 5 x 10 User # 2 U1 UPDATE prod SET large_col... WHERE id = XYZ 5 XYZ Zack database buffer cache
Redo Buffer Operation Redo Buffer User #1 When user enters… Redo Buffer User #1 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack This continues for all changes 1234 5 x 10 User # 2 U1 UPDATE prod SET large_col... WHERE id = XYZ 5 U2 XYZ Zack Zack database buffer cache
Redo Buffer Operation Redo Buffer xx User #1 When user enters… Redo Buffer User #1 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack This continues for all changes 1234 5 T87 4 89 28 22 &&& x 10 User # 2 U1 UPDATE prod SET large_col... WHERE id = XYZ 5 U2 XYZ xx &&&& Zack Zack database buffer cache
Redo Buffer Operation Redo Buffer xx User #1 When user enters… Redo Buffer User #1 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id UPDATE emp SET sal = 10 WHERE id = 1234 1234 5 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack This continues for all changes 1234 5 T87 4 89 28 22 &&&& x 20 x 10 T1 3 12 - - 10 User # 2 U1 T1 2 123 41 6 20 UPDATE prod SET large_col... WHERE id = XYZ 5 10 User #1 U2 XYZ UPDATE emp SET sal = 20 WHERE id =1234 xx &&&& Zack Zack database buffer cache
Redo Buffer Operation Redo Buffer xx User #1 commit; Then a user commits data file 2 undo file 3 data file 4 Tran File Block Row Column Value id User #1 1234 5 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 commit; T87 3 65 - - Zack file:block file:block 1234 5 T87 4 89 28 22 &&&& x 20 x 10 2:123 T1 3 12 - - 10 U1 T1 2 123 41 6 20 5 3:12 10 U2 XYZ 3:65 xx &&&& 4:89 Zack Zack database buffer cache
Redo Buffer Operation Redo Buffer xx User #1 commit; Then a user commits data file 2 undo file 3 data file 4 Tran File Block Row Column Value id User #1 1234 5 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 commit; T87 3 65 - - Zack And an entry recording the commit is made in the REDO buffer 1234 5 T87 4 89 28 22 &&&& x 20 x 10 T1 3 12 - - 10 U1 T1 2 123 41 6 20 5 10 T1 commit SCN time stamp U2 XYZ xx &&&& Zack Zack database buffer cache
Redo Buffer Operation Redo Buffer xx User #1 commit; Then a user commits data file 2 undo file 3 data file 4 Tran File Block Row Column Value id User #1 1234 5 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 commit; T87 3 65 - - Zack And an entry recording the commit is made in the REDO buffer 1234 5 T87 4 89 28 22 &&&& x 20 x 10 T1 3 12 - - 10 U1 This entry consists of: T1 2 123 41 6 20 5 a “code” to indicate this is a commit (as opposed to a rollback or checkpoint) a timestamp the current SCN 10 T1 commit SCN time stamp U2 XYZ xx &&&& Zack Zack database buffer cache
Thought you’d never ask!!! Redo Buffer Operation What is an SCN? Thought you’d never ask!!!
System Change Number SCN is the System Change Number sequentially assigned by LGWR to indicate the “time” of a commit, rollback or checkpoint
System Change Number SCN is the System Change Number sequentially assigned by LGWR to indicate the “time” of a commit, rollback or checkpoint For Example: 3256 this SCN was assigned to the last transaction that issued a commit
System Change Number SCN is the System Change Number sequentially assigned by LGWR to indicate the “time” of a commit, rollback or checkpoint For Example: 3256 3257 this SCN was assigned to the last transaction that issued a commit
System Change Number SCN is the System Change Number sequentially assigned by LGWR to indicate the “time” of a commit, rollback or checkpoint For Example: 3256 3257 3258 this SCN was assigned to the last transaction that issued a commit
System Change Number SCN is the System Change Number sequentially assigned by LGWR to indicate the “time” of a commit, rollback or checkpoint For Example: 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 this SCN was assigned to the last transaction that issued a commit
System Change Number SCN is the System Change Number sequentially assigned by LGWR to indicate the “time” of a commit, rollback or checkpoint For Example: 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 If one SCN is larger than another it means it was committed after the smaller was committed… and vice versa
Redo Buffer Operation Redo Buffer The log data will now get written to the logfile by the log writer (LGWR). Redo Buffer T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp LGWR LGWR writes when: Commit Buffer is 1/3 full Checkpoint 1 Meg of data in buffer DBWR writes 3 seconds Log 1 Log 2
Redo Buffer Operation Redo Buffer LGWR T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp LGWR Notice that even though it was only transaction T1 that committed the data for T87 also was written even though it is not committed. Log 1 Log 2
Redo Buffer Operation Redo Buffer While this data is being written to the log file other data can continue to be placed in the redo buffer until the buffer is full. T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp LGWR T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp Log 1 Log 2
Redo Buffer Operation Redo Buffer While this data is being written to the log file other data can continue to be placed in the redo buffer until the buffer is full. Notice the two commits. T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp LGWR T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp Log 1 Log 2
Redo Buffer Operation Redo Buffer While this data is being written to the log file other data can continue to be placed in the redo buffer until the buffer is full T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp LGWR T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp Since LGWR is busy the two commits are “piggybacked” LGWR will write both at the same time and will use the same SCN for both Log 1 Log 2
Redo Buffer Operation Redo Buffer When LGWR finishes writing the group of log records the user is notified that their data has been committed. LGWR then begins writing the next group of log records. T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp LGWR T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp Log 1 Log 2
Redo Buffer Operation Redo Buffer LGWR Log 1 Log 2 T1 3 12 - - 5 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp LGWR Log 1 Log 2
Redo Buffer Operation Redo Buffer Additional data continues to be added to the redo buffer overwriting the previously written data T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp LGWR T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 Log 1 Log 2
Redo Buffer Operation Redo Buffer Additional data continues to be added to the redo buffer overwriting the previously written data T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp LGWR T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 Log 1 Log 2
OUCH! Redo Buffer Operation Redo Buffer The REDO BUFFER just filled up! T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp LGWR T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 Log 1 Log 2
Redo Buffer Operation All the users doing DML get this object on their screen for their efforts!
Redo Buffer Operation
REDO BUFFER needs to be larger Redo Buffer Operation Redo Buffer Solution: REDO BUFFER needs to be larger T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp LGWR T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 Log 1 Log 2
NOW…. To revert back to our discussion about the physical redo logs
Redo Log Operation LGWR continues writing to the log until the log fills up. LGWR Log 1 Log 2
Redo Log Operation LGWR continues writing to the log until the log fills up. LGWR Log 1 Log 2
Redo Log Operation LGWR continues writing to the log until the log fills up. LGWR Log 1 Log 2
Redo Log Operation This is called a log switch. LGWR continues writing to the log until the log fills up. LGWR then begins writing to the next redo log. This is called a log switch. LGWR Log 1 Log 2
Redo Log Operation For safety’s sake redo logs should always be mirrored. ALTER DATABASE ADD LOGFILE MEMBER log1b TO GROUP 1; ALTER DATABASE ADD LOGFILE MEMBER log2b TO GROUP 2; Note: this method is recommended instead of or in addition to using hardware mirroring Log 1 Log 2 a Log 1 Log 2 b
Redo Log Operation For safety’s sake redo logs should always be mirrored. ALTER DATABASE ADD LOGFILE MEMBER log1b TO GROUP 1; ALTER DATABASE ADD LOGFILE MEMBER log2b TO GROUP 2; Note: this method is recommended instead of or in addition to using hardware mirroring LGWR will then write to the multiple logs simultaneously LGWR Log 1 Log 2 a Log 1 Log 2 b
Database Recovery The Oracle recovery process has three parts performed in this order: Roll Forward: all changes made to data blocks that had not been written to the data files on disk are performed again by reapplying (redoing) the images originally recorded on the Redo Log. Open Database: users can begin normal operations Rollback: uncommitted transactions are rolled back using the undo log
Database Recovery Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id 1234 20 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack When recovery begins the control file is accessed to determine which enty in the redo log is to be used to start the roll foward portion of recovery. T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 Control File database buffer cache
Database Recovery Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id 1234 20 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack That entry in the Redo Log is accessed. T87 4 89 28 22 &&&& T1 3 12 - - 10 The referenced block is retrieved from disk to the database buffer cache (unless it’s already there). It happens to be a roll back block. U1 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 database buffer cache
Database Recovery Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id 1234 20 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack That entry in the Redo Log is accessed. T87 4 89 28 22 &&&& T1 3 12 - - 10 The referenced block is retrieved from disk to the database buffer cache (unless it’s already there). It happens to be a roll back block. U1 T1 2 123 41 6 20 5 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 The roll back data is recreated showing the ‘before image’ database buffer cache
Database Recovery Redo Log T1 3 12 - - 5 Then… T1 2 123 41 6 10 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id 1234 20 XYZ Zack T1 3 12 - - 5 Then… T1 2 123 41 6 10 T87 3 65 - - Zack The data block is retrieved from disk to the database buffer cache (unless it’s already there) 1234 20 T87 4 89 28 22 &&&& T1 3 12 - - 10 U1 T1 2 123 41 6 20 5 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 database buffer cache
Database Recovery Redo Log T1 3 12 - - 5 Then… T1 2 123 41 6 10 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id 1234 20 XYZ Zack T1 3 12 - - 5 Then… T1 2 123 41 6 10 T87 3 65 - - Zack The data block is retrieved from disk to the database buffer cache (unless it’s already there) 1234 20 T87 4 89 28 22 &&&& T1 3 12 - - 10 U1 T1 2 123 41 6 20 5 Notice that the value in the data block is greater than the redo data! T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 database buffer cache
Database Recovery Redo Log T1 3 12 - - 5 Then… T1 2 123 41 6 10 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id 1234 20 XYZ Zack T1 3 12 - - 5 Then… T1 2 123 41 6 10 T87 3 65 - - Zack The data block is retrieved from disk to the database buffer cache (unless it’s already there) 1234 20 x 10 T87 4 89 28 22 &&&& T1 3 12 - - 10 U1 T1 2 123 41 6 20 5 Notice that the value in the data block is greater than the redo data! T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 The data is recreated showing the ‘after image’ database buffer cache
Database Recovery Redo Log T1 3 12 - - 5 T1 2 123 41 6 10 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id 1234 20 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack Then the next entry .... 1234 20 x 10 T87 4 89 28 22 &&&& T1 3 12 - - 10 U1 T1 2 123 41 6 20 5 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 U2 Zack database buffer cache
Database Recovery Redo Log xx T1 3 12 - - 5 T1 2 123 41 6 10 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id 1234 20 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack and the next ...... 1234 20 x 10 T87 4 89 28 22 &&&& T1 3 12 - - 10 XYZ U1 T1 2 123 41 6 20 xx &&&& Zack 5 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 U2 Zack database buffer cache
Database Recovery Redo Log xx T1 3 12 - - 5 T1 2 123 41 6 10 data file 2 undo file 3 data file 4 Tran File Block Row Column Value id 1234 20 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack etc., 1234 20 x 10 T87 4 89 28 22 &&&& T1 3 12 - - 10 XYZ U1 T1 2 123 41 6 20 xx &&&& Zack 5 10 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 U2 Zack database buffer cache
Database Recovery Redo Log xx data file 2 undo file 3 data file 4 Tran File Block Row Column Value id 1234 20 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack etc., etc., 1234 20 x 20 T87 4 89 28 22 &&&& T1 3 12 - - 10 XYZ U1 T1 2 123 41 6 20 xx &&&& Zack 5 Notice that the value in the data block has now been restored to the value on disk. 10 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 U2 Zack database buffer cache
Database Recovery Redo Log xx C C data file 2 undo file 3 data file 4 Tran File Block Row Column Value id 1234 20 XYZ Zack T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack etc., etc., etc. 1234 20 x 20 T87 4 89 28 22 &&&& C T1 3 12 - - 10 XYZ U1 The transaction has been “re-committed” T1 2 123 41 6 20 xx &&&& Zack 5 10 C T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 U2 Zack database buffer cache
Database Recovery Keypoint Redo Log Tran File Block Row Column Value T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 data file 2 undo file 3 data file 4 1234 20 XYZ Zack Keypoint After processing the remainder of the redo log.... 1234 20 x 20 C XYZ U1 xx &&&& Zack 5 the buffer cache and data files will have been rebuilt to appear as they were at the time of the crash. 10 C U2 Zack database buffer cache
Database Recovery Redo Log Tran File Block Row Column Value T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 data file 2 undo file 3 data file 4 1234 20 XYZ Zack The database is then opened so the users can begin work..... 1234 20 x 20 C XYZ U1 xx &&&& Zack 5 10 C U2 Zack database buffer cache
Database Recovery Redo Log Tran File Block Row Column Value T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 data file 2 undo file 3 data file 4 then all uncommitted transactions will be rolled back. 1234 20 XYZ Zack The database is then opened so the users can begin work..... 1234 20 x 20 C XYZ U1 xx &&&& Zack 5 10 C U2 Zack database buffer cache
Database Recovery Beginning with 9i Redo Log Tran File Block Row Column Value T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Beginning with 9i The method for performing the roll forward phase has been changed to improve performance. DBWn 3 / 12 2/123 3 / 65 4 / 89
Database Recovery Beginning with 9i Redo Log Tran File Block Row Column Value T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Beginning with 9i An entry is placed in the redo log whenever DBWR writes data to disk . It identifies the blocks that were just written. DBWn 3 / 12 2/123 3 / 65 4 / 89
Database Recovery Beginning with 9i Redo Log Tran File Block Row Column Value T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 Beginning with 9i To improve performance during instance recovery the redo log is processed twice first to identify the entries that need to be processed second to process the selected entries DBWn 3 / 12 2/123 3 / 65 4 / 89
Identify the Entries First pass of redo data Redo Log Tran File Block Row Column Value T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 First pass of redo data Identify redo that needs to be processed No data blocks are read Very fast DBWn 3 / 12 2/123 3 / 65 4 / 89
Identify the Entries Copy the REDO.... Redo Log Tran File Block Row Column Value T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 DBWn 3 / 12 2/123 3 / 65 4 / 89 Copy the REDO....
Remove entries for those blocks already written.... Identify the Entries Redo Log Tran File Block Row Column Value T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 DBWn 3 / 12 2/123 3 / 65 4 / 89 Remove entries for those blocks already written....
Remove entries for those blocks already written.... Identify the Entries Redo Log Tran File Block Row Column Value T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 DBWn 3 / 12 2/123 3 / 65 4 / 89 Remove entries for those blocks already written....
Remove entries for those blocks already written.... Identify the Entries Redo Log Tran File Block Row Column Value T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 DBWn 3 / 12 2/123 3 / 65 4 / 89 Remove entries for those blocks already written....
Remove entries for those blocks already written.... Identify the Entries Redo Log Tran File Block Row Column Value T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 DBWn 3 / 12 2/123 3 / 65 4 / 89 Remove entries for those blocks already written....
Remove entries for those blocks already written.... Identify the Entries Redo Log Tran File Block Row Column Value T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 DBWn 3 / 12 2/123 3 / 65 4 / 89 Remove entries for those blocks already written....
Identify the Entries Finish the list.... Redo Log Tran File Block Row Column Value T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 DBWn 3 / 12 2/123 3 / 65 4 / 89 Finish the list....
Identify the Entries Redo Log Tran File Block Row Column Value T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 DBWn 3 / 12 2/123 3 / 65 4 / 89 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77
Identify the Entries Redo Log Tran File Block Row Column Value T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77 DBWn 3 / 12 2/123 3 / 65 4 / 89 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77
Second pass of redo data Process the Entries Second pass of redo data Recover using these selected entries T1 3 12 - - 5 T1 2 123 41 6 10 T87 3 65 - - Zack T87 4 89 28 22 &&&& T1 3 12 - - 10 T1 2 123 41 6 20 T1 commit SCN# time stamp T87 3 65 - - &&&& T87 4 89 28 22 #### T2 3 20 - - - T2 7 47 34 9 22 T2 commit SCN# time stamp T3 6 10 - - 15 T3 22 17 61 7 22 T3 commit SCN# time stamp T87 3 65 - - #### T87 4 89 28 22 @@@ T4 3 20 - - 15 T4 7 47 34 9 22 T4 3 20 - - 22 T4 7 47 34 9 33 T4 3 20 - - 33 T4 7 47 34 9 44 T87 3 65 - - @@@ T87 4 89 28 22 ++++ T4 3 20 - - 44 T4 7 47 34 9 55 T4 3 20 - - 55 T4 7 47 34 9 66 T4 3 20 - - 66 T4 7 47 34 9 77
This concludes the demonstration of Redo Logs and Recovery