UW CSE 444 - Logging and Conflict Serializability (24 pages)

Previewing pages 1, 2, 23, 24 of 24 page document View the full content.
View Full Document

Logging and Conflict Serializability



Previewing pages 1, 2, 23, 24 of actual document.

View the full content.
View Full Document
View Full Document

Logging and Conflict Serializability

79 views

Problems/Exams


Pages:
24
School:
University of Washington
Course:
Cse 444 - Database Internals
Database Internals Documents

Unformatted text preview:

Logging and conflictserializability CSE 444 section July 15 2010 Today Logging and recovery exercises Identifying conflict serializable schedules Why do we need to recover a DB Why use log based recovery Helps satisfy 2 of the ACID constraints Atomicity How does log based recovery keep TXen atomic How is this done in an undo log In a redo log Durability How does logging ensure that TXen persist When to use log based recovery When it helps When the DBMS program crashes When the computer loses power When it doesn t help When the disk crashes both data log corrupt On user error database is still consistent Our undo log notation START T Transaction T has begun COMMIT T T has committed ABORT T T has aborted T X v Update record T has updated element X and its old value was v An undo logging problem Given this undo log when can each data item be output to disk 1 START T1 A after 2 2 T1 A a 3 T1 B b B after 3 4 START T2 5 T2 C c C after 5 before 12 6 START T3 D after 7 7 T3 D d 8 T2 E e E after 8 before 12 9 START T4 10 T4 F f F after 10 11 T3 G g 12 COMMIT T2 G after 11 Undo logging problem continued After writing these log entries the DBMS crashes What does it do when it restarts Scan for transactions to 1 START T1 2 T1 A a undo T1 T3 T4 3 T1 B b 4 START T2 G F D B A reverted 5 T2 C c 6 START T3 in that order 7 T3 D d ABORT written for 8 T2 E e 9 START T4 T1 T3 T4 10 T4 F f 11 12 T3 G g COMMIT T2 What if it was a redo log Now T X v means X s new value is v so now when can we output each item 1 START T1 C E after 12 2 T1 A a 3 T1 B b Others never 4 START T2 5 T2 C c given log available 6 START T3 7 8 9 10 11 12 T3 D d T2 E e START T4 T4 F f T3 G g COMMIT T2 Redo log problem continued How do we recover from this redo log Scan for transactions to redo only T2 C and E rewritten 1 2 3 4 5 6 7 8 9 10 11 12 START T1 T1 A a T1 B b START T2 T2 C c START T3 T3 D d T2 E e START T4 T4 F f T3 G g COMMIT T2 Why add non quiescent checkpoints Undo log recovery with checkpoints The DBMS



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view Logging and Conflict Serializability and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Logging and Conflict Serializability and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?