! " ! # $ % & ! ! # ' '( ' ) '( ) ! ! # &' ' '( ' ) '( ) ! ! # ' ! ! # *+, ! ! # *-, ! ! # *+, ! ! # ' ! ! . / ! ! ! ! ! ' ! 00 - !' 00 1 22!)34*35 3'3 ,-*6 3537 3'3 ,-*6' $' 8)3-3 $9 :" $9 :" $;< ! * !00 ! ! $ ! ! ! !"# 7 $: ='' (> :?@1 3'3 *=A ,-*6 -: -$-: - 8)3-3 -$@;<-@:"-$:9-: 7 : =''( B' :?@1 -3:3: 3-*3," )34 3'3*=A ,-*6-: -$-: - 8)3-3-$@;<-@:"-$:9-:9 B$CD & ! 1 , $ ?"?:@? !1@ -$, ?"?: @,:E F:@"G @?"?: !1@" -$, , @ @?"?:@, F:"@@"G@, E0 . :@?""?: !1:@@" -., :@" @,"?:" !-F:"@"G :@?" @, H :?@@?":? !1: -$, .,@?" @?" @,@ !-F@":@G / :@?:@?"?:"?@ !1:@@":" -., @, ,"1?: ?:"?@ - F:@"G :@?:@?"@" @,"?@ - F:@""G)((( :@ :@" @, @, $ % % % % : $ . % % H% % : $. $ '.1.(! ( $ '$1/(! ( H (!:& (& % #$.H/ $1& 1& 1 $1 $1% $1 H1( % 1 %&' H1 %$&'( .1 /1 Q6: Recovering from a system failure: 1- Scan the log from tail (newest) to head (oldest) : Create a list of committed transactions T1,T3,T5 T4 aborted, T2 and T6 active 2- Undo updates of active and aborted transactions (T6,A,2,3) A = 2 (T6,X,400,0) X = 400 (T4,A,0,1) A = 0 (T2,Y,10,20) Y = 10 Scan the log from head (oldest) to tail (newest): Redo updates of committed transactions (T1,X,0,10) X = 10 (T3,X,10,400) X = 400 (T3,Z,0,100) Z = 100 (T5,A,0,2) A = 2 Thus, T1,T3 & T5 are committed while T2,T4 & T6 are aborted Object value changes (last is final) A: 2,0,2 X: 400,10,400 Y: 10 Z: 100
© Copyright 2025