184
Chapter 18
LSN 20
Add (T1,20) to TT and (P1,20) to DPT
LSN 30
Add (T2,30) to TT and (P2,30) to DPT
LSN 40
Add (T3,40) to TT and (P3,40) to DPT
LSN 50
Change status of T2 to C
LSN 60
Change (T3,40) to (T3,60)
LSN 70
Remove T2 from TT
LSN 80
Change (T1,20) to (T1,70) and add (P5,70) to DPT
LSN 90
No action
At the end of analysis, the transaction table contains the following entries: (T1,80),
and (T3,60). The Dirty Page Table has the following entries: (P1,20), (P2,30),
(P3,40), and (P5,80).
3. Redo starts from LSN20 (minimum recLSN in DPT).
LSN 20
Check whether P1 has pageLSN more than 10 or not. Since it is a
committed transaction, we probably need not redo this update.
LSN 30
Redo the change in P2
LSN 40
Redo the change in P3
LSN 50
No action
LSN 60
Redo the changes on P2
LSN 70
No action
LSN 80
Redo the changes on P5
LSN 90
No action
4. ToUndo consists of (80, 60).
LSN 80
Undo the changes in P5.
Append a CLR: Undo T1 LSN 80, set
undonextLSN = 20. Add 20 to ToUndo.
ToUndo consists of (60, 20).
LSN 60
Undo the changes on P2. Append a CLR: Undo T3 LSN 60, set
undonextLSN = 40. Add 40 to ToUndo.
ToUndo consists of (40, 20).
LSN 40
Undo the changes on P3. Append a CLR: Undo T3 LSN 40, T3
end
ToUndo consists of (20).
This
preview
has intentionally blurred sections.
Sign up to view the full version.

This is the end of the preview.
Sign up
to
access the rest of the document.
- Fall '12
- Dr.Vishak
- Following, Harshad number, Undo
-
Click to edit the document details