Presentation is loading. Please wait.

Presentation is loading. Please wait.

Recovery Part 1 Lecture 15. Database Recovery Transactions make ACID properties possible Until now all locking has been abstract objects – What’s the.

Similar presentations


Presentation on theme: "Recovery Part 1 Lecture 15. Database Recovery Transactions make ACID properties possible Until now all locking has been abstract objects – What’s the."— Presentation transcript:

1 Recovery Part 1 Lecture 15

2 Database Recovery Transactions make ACID properties possible Until now all locking has been abstract objects – What’s the right granularity for locking? Single-level v. multi-level locking

3 Study Break: Intention Locks T1.IX(Table A) T2.IX(Table A) T1.IX(Page A.1) T2.IX(Page A.1) T1.X(Tuple A.1.1) T2.X(Tuple A.1.2) T1.IX(Table A) T2.IS(Table A) T1.X(Page A.1) T2.IS(Page A.1) T2.S(Tuple A.1.1) Are the following lockings legal? Consider transactions (T1, T2) with X, IX, S, SX locks.

4 Recovery Cope with crashes Assure that we have atomicity and durability Need to make it s.t. the db is in a consistent state after recovery protocol is run Do this with write ahead logging Buffer pool needs to not interfere w/recovery

5 Study Break: Logging 3 Transactions (TA, TB, TC) Transaction begins with x = 10, y = 100 After crash, before recovery have y = 200 After recovery have x = 110 What happened? What is the log? Use commit, update, and abort commands TA X = X + 1 Y = Y * 3 TB Y = Y * 2 X = X + 5 TC X = X * 10

6 Study Break: Logging Solution TransactionTypeItemOld ValueNew Value TAUpdateX1011 TBUpdateY100200 TBAbort TAUpdateY200300 TACommit TCUpdateX11110 TCCommit


Download ppt "Recovery Part 1 Lecture 15. Database Recovery Transactions make ACID properties possible Until now all locking has been abstract objects – What’s the."

Similar presentations


Ads by Google