Redo Logs and Recovery John Hibbard Senior Principal Instructor

Slides:



Advertisements
Similar presentations
What is Concurrent Process (CP)? Multiple users access databases and use computer systems Multiple users access databases and use computer systems simultaneously.
Advertisements

1 CSIS 7102 Spring 2004 Lecture 9: Recovery (approaches) Dr. King-Ip Lin.
Transactions and Recovery Checkpointing Souhad Daraghma.
Oracle Architecture. Instances and Databases (1/2)
CSCI 3140 Module 8 – Database Recovery Theodore Chiasson Dalhousie University.
Jan. 2014Dr. Yangjun Chen ACS Database recovery techniques (Ch. 21, 3 rd ed. – Ch. 19, 4 th and 5 th ed. – Ch. 23, 6 th ed.)
Recovery from Crashes. ACID A transaction is atomic -- all or none property. If it executes partly, an invalid state is likely to result. A transaction,
More on transactions…. Dealing with concurrency (OR: how to handle the pressure!) Locking Timestamp ordering Multiversion protocols Optimistic protocols.
Recovery 10/18/05. Implementing atomicity Note, when a transaction commits, the portion of the system implementing durability ensures the transaction’s.
ACID A transaction is atomic -- all or none property. If it executes partly, an invalid state is likely to result. A transaction, may change the DB from.
1 - Oracle Server Architecture Overview
Chapter 19 Database Recovery Techniques. Slide Chapter 19 Outline Databases Recovery 1. Purpose of Database Recovery 2. Types of Failure 3. Transaction.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Transaction Management and Concurrency Control.
Recovery Basics. Types of Recovery Catastrophic – disk crash –Backup from tape; redo from log Non-catastrophic: inconsistent state –Undo some operations.
Backup and Recovery Part 1.
ITEC474 Redo Log Files.
Database Backup & Recovery David Konopnicki. Introduction A major responsibility of the database administrator is to prepare for the possibility of hardware,
Oracle Architecture. Database instance When a database is started the current state of the database is given by the data files, a set of background (BG)
Oracle9i Database Administrator: Implementation and Administration
Redo Waits Kyle Hailey #.2 Copyright 2006 Kyle Hailey Log File Waits  Redo is written to disk when  User commits  Log Buffer.
7 Maintaining Redo Log Files. 7-2 Objectives Explaining the use of online redo log files Obtaining log and archive information Controlling log switches.
Redo Waits Kyle Hailey #.2 Copyright 2006 Kyle Hailey Redo REDO Lib Cache Buffer Cache Locks Network I/O.
DBMS Transactions and Rollback Recovery Helia / Martti Laiho.
By Lecturer / Aisha Dawood 1.  You can control the number of dispatcher processes in the instance. Unlike the number of shared servers, the number of.
CSE 781 – DATABASE MANAGEMENT SYSTEMS Introduction To Oracle 10g Rajika Tandon.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 10 Transaction Management.
Reliability and Security in Database Servers By Samuel Njoroge.
7202ICT – Database Administration
1 Oracle Architectural Components. 1-2 Objectives Listing the structures involved in connecting a user to an Oracle server Listing the stages in processing.
Copyright  Oracle Corporation, All rights reserved. 1 Oracle Architectural Components.
Chapterb19 Transaction Management Transaction: An action, or series of actions, carried out by a single user or application program, which reads or updates.
An Oracle server:  Is a database management system that provides an open, comprehensive, integrated approach to information management.  Consists.
© Dennis Shasha, Philippe Bonnet 2001 Log Tuning.
Chapter 16 Recovery Yonsei University 1 st Semester, 2015 Sanghyun Park.
Database structure and space Management. Database Structure An ORACLE database has both a physical and logical structure. By separating physical and logical.
Week 3 Lecture 1 The Redo Log Files and Diagnostic Files.
1 Principles of Database Systems With Internet and Java Applications Today’s Topic Chapter 15: Reliability and Security in Database Servers Instructor’s.
Process Architecture Process Architecture - A portion of a program that can run independently of and concurrently with other portions of the program. Some.
Instance and Media Recovery Structures Supinfo Oracle Lab. 7.
1 Chapter 6 Database Recovery Techniques Adapted from the slides of “Fundamentals of Database Systems” (Elmasri et al., 2003)
Backup and Recovery - II - Checkpoint - Transaction log – active portion - Database Recovery.
Transactional Recovery and Checkpoints Chap
Oracle Architecture - Structure. Oracle Architecture - Structure The Oracle Server architecture 1. Structures are well-defined objects that store the.
7 Copyright © Oracle Corporation, All rights reserved. Instance and Media Recovery Structures.
Transactional Recovery and Checkpoints. Difference How is this different from schedule recovery? It is the details to implementing schedule recovery –It.
14 Copyright © 2005, Oracle. All rights reserved. Backup and Recovery Concepts.
1-1 Copyright © Oracle Corporation, All rights reserved. Redo Logs and Recovery John Hibbard Senior Principal Instructor Minneapolis MN
Database Recovery Zheng (Godric) Gu. Transaction Concept Storage Structure Failure Classification Log-Based Recovery Deferred Database Modification Immediate.
14 Copyright © 2007, Oracle. All rights reserved. Backup and Recovery Concepts.
Oracle 11g: SQL Chapter 5 Data Manipulation and Transaction Control.
Oracle Database Architectural Components
CS422 Principles of Database Systems Failure Recovery Chengyu Sun California State University, Los Angeles.

Database recovery techniques
Database Recovery Techniques
Database Recovery Techniques
Transactional Recovery and Checkpoints
Maintaining Online Redo Log Files
Transaction Management and Concurrency Control
Enforcing the Atomic and Durable Properties
Instance and Media Recovery Structures
Kyle Hailey Redo Waits Kyle Hailey
Oracle9i Database Administrator: Implementation and Administration
Recovery System.
Oracle Architectural Components
Database Recovery 1 Purpose of Database Recovery
CS347 Spring 2017 – Quiz 5 Preparation - Solutions UTEID _________
Chapter 5 The Redo Log Files.
Recovery Unit 4.4 Dr Gordon Russell, Napier University
Presentation transcript:

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