Download presentation
Presentation is loading. Please wait.
Published bySharyl Gilbert Modified over 9 years ago
1
DBMS Transactions and Rollback Recovery Helia / Martti Laiho
2
Control Buffers Data Buffer (Buffer pool) Log Buffer Transaction Log files - Connections - Transaction queueing - Locking List - etc before image / after image Table pages and index pages x Database Instance Checkpoint: Commit/Rollback: Application programs - Sessions (connections) - Transactions - SQL commands Helia / Martti Laiho, 1998-2003 DBMS Listener / Server Transaction Manager SQL Engine (parser) Security Manager Query Optimizer Concurrency Manager (Lock Manager) Recovery Manager Relational Engine Memory Manager DBMS Listener / Server Transaction Manager SQL Engine (parser) Security Manager Query Optimizer Concurrency Manager (Lock Manager) Recovery Manager Relational Engine Memory Manager LRU x Data file File Manager Disk Manager read write
3
Processing a Transaction Insert into table Update table Delete from table Select.. Commit / Rollback undo /redo data commit / rollback LGWR OK ? continue User process:Data bufferRedo log buffer Redo log files (Rollback Segments - Oracle only) undo undo data ? On Rollback before imagesafter images
4
Marking Checkpoint into Transaction Log time T1 T2 T3 T4 T5 Write Checkpoint record into the log of the current transactions tctc Helia / Martti Laiho, 1998-2005 Commit Rollback Commit Begin Write all after images Into the database
5
A Soft Crash time T1 T2 T3 T4 T5 Checkpoint record System Failure tctc tftf “Soft Crash” Helia / Martti Laiho, 1998-2005 Commit Rollback Commit
6
Rollback recovery using transaction log time T1 T2 T3 T4 T5 Checkpoint record tctc tftf Rollback Recovery: Undo list: T1, T2, T3, T4, T5 Redo list: - Helia / Martti Laiho, 1998-2005 Commit Rollback Commit 2. Find the last checkpoint record 3. Add transactions on undo list 1. Start up From checkpoint record From the log after the checkpoint
7
Rollback recovery using transaction log time T1 T2 T3 T4 T5 Checkpoint record tctc tftf Rollback Recovery Undo list: T1, T2, T3, T4, T5 Redo list: T1, T4 Helia / Martti Laiho, 1998-2005 Commit Rollback Commit 3 4. Move committed transactions to Redo list
8
Rollback recovery using transaction log time T1 T2 T3 T4 T5 Checkpoint record tctc tftf Helia / Martti Laiho, 1998-2005 Commit Rollback Commit Rollback Recovery Undo list: T1, T2, T3, T4, T5 Redo list: T1, T4 5 5. Rollback transactions of the Undo list - writing the before images into the database Redo transactions of the Redo list - writing the after images into the database 6. Open the DBMS service to applications undo redo undo
Similar presentations
© 2024 SlidePlayer.com Inc.
All rights reserved.