Title: ??a?e???s? S??a??a???
115
- S??a??a???
- ??e???? ta?t??????sµ??
- ?pa???t?s? ded?µ????
2?ef??a?? 15 ??a?e???s? S??a??a???
S??a??a???
- ??a s????? ?e?t??????? t? ?p??? ap?te?e? µ?a
?????? ?e?t??????? µ???da ?a?e?ta? s??a??a??
(transaction). - ??a s??a??a?? pe????e?
- e?t???? a?????s??,
- e?t???? e?sa?????,
- e?t???? d?a??af??, ?
- e?t???? e??µ???s??
- t?? ded?µ???? t?? ??.
3?ef??a?? 15 ??a?e???s? S??a??a???
S??a??a???
- ? p???p????t?ta t?? s???????? ß?se?? ded?µ????
?d??e? st?? a??pt??? a???p?st?? µ??a??sµ??
e?????? t?? a?e?a??t?ta? t?? ded?µ???? - p????? s??a??a??? µp??e? ?a ß??s???ta? se
e??????, p??spe?a????ta? ????? ded?µ??a - ? ??e???? ta?t??????sµ?? (concurrency control)
d?a?e????eta? t?? s??a??a??? ?ts? ?ste ?a
ap?fe????ta? ?? pa????????? ?atast?se??
4?ef??a?? 15 ??a?e???s? S??a??a???
S??a??a???
- ??a ?? µp??e? ?a ß?e?e? se asta?? ?at?stas?
- ap? µ?a ß??ß? t?? s?st?µat?? (ß??ß? t?? f?s????
µ?s?? ap????e?s??) ? (????? µ????? t??
s?st?µat??), - µet? t?? ap??at?stas? t?? ß??ß?? p?a?µat?p??e?ta?
??e???? t?? ded?µ????. - ?p???e? a????? ?pa???? µ??a??sµ?? epa???t?s??
(recovery) ded?µ????, ?ste ?a epa????e? ? ?? st??
?a?????? t?? ?at?stas? ?p?? p??????ta? ???? ??
pe?????sµ?? a?e?a??t?ta?.
5?ef??a?? 15 ??a?e???s? S??a??a???
S??a??a???
- ??a s??a??a?? e??a? s?????? t? ap?t??esµa t??
e?t??es?? e??? p?????µµat?? p?? e??a? ??aµµ??? se
µ?a ???ssa p????aµµat?sµ?? ?????? ep?p?d??. - ?? e?t???? p?? p??sd???????? µ?a s??a??a??
pe????e???ta? µeta?? t?? e?f??se?? - BEGIN TRANSACTION, ?a?
- END TRANSACTION.
6?ef??a?? 15 ??a?e???s? S??a??a???
?atast?se?? S??a??a???
- ??a s??a??a?? µp??e? ?a ??e? t?? e??? ?atast?se??
7?ef??a?? 15 ??a?e???s? S??a??a???
?atast?se?? S??a??a???
- ??e??? (active) ?at?stas?
- ? s??a??a?? e?s???eta? st?? e?e??? ?at?stas? ?at?
t?? a??? t?? epe?e??as?a? t?? ?a? pa?aµ??e? se
a?t? e??s? e?te?e?ta?. - ?at?stas? ?e????? ??sµe?s?? (partial commit)
- ? s??a??a?? ?e??e?ta? µe????? desµe?µ??? ?ta?
??e? ?????????e? ?a? ? te?e?ta?a e?t??? t??
s??a??a???. - ?at?stas? ?p?t???a? (failed)
- ? s??a??a?? ap?t?????e? ?ta? t? S??? a?t???f?e?
?t? de? µp??e? ?a s??e??se? t?? ?µa?? epe?e??as?a
t??
8?ef??a?? 15 ??a?e???s? S??a??a???
?atast?se?? S??a??a???
- ?at?stas? ?p??????? (aborted)
- ? s??a??a?? ß??s?eta? st?? ?at?stas? a?t? ?ta? ta
ded?µ??a ????? epa????e? st?? p??????µe?? sta?e??
?at?stas?, p??? t?? a??? t?? e?t??es?? t??
s??a??a???. - st?? ?at?stas? ap??????? t? S??? ??e? d??
ep?????? (a) t?? epa?e?????s? t?? s??a??a???
ap? t?? a??? ? (ß) t?? ?atast??f? t??
s??a??a???. - ?at?stas? ??sµe?s?? (committed)
- ? s??a??a?? ??e? ????????se? ep?t???? t??
e?t??es? t??.
9?ef??a?? 15 ??a?e???s? S??a??a???
?d??t?te? S??a??a??? (ACID)
- ?t?µ???t?ta (atomicity)
- a? ?p???e? ?st? ?a? µ?a e?t??? t?? s??a??a???, ?
?p??a ap?t?????e? ?a e?te?es?e?, t?te ???????? ?
s??a??a?? ap?t?????e? ep?s??. - ?p?µ???s? (isolation)
- ???e s??a??a?? p??pe? ?a e?te?e?ta? a?e???t?ta
ap? ???e? s??a??a??? - ????µ?t?ta (durability)
- a? µ?a s??a??a?? ?????????e? µe ep?t???a, t?te ??
a??a??? p?? ??e? ep?f??e? ?ata???f??ta? µ???µa
st? ?? ?a? de? µp????? ?a a?a???????.
10?ef??a?? 15 ??a?e???s? S??a??a???
?d??t?te? S??a??a??? (ACID)
- S???pe?a (consistency)
- ? s??a??a?? p??pe? ?a µetat??pe? t? ß?s?
ded?µ???? ap? µ?a s??ep? ?at?stas? se µ?a ????
s??ep? ?at?stas? (ta ded?µ??a p??pe? ?a e??a?
????). - ?? µ??a??sµ?? a?e?a??t?ta? ded?µ???? de? epa?????
??a t?? e????s? t?? s???pe?a?. - Te??e?ste t? µetaf??? e??? p?s?? ap? ??a?
t?ape???? ???a??asµ? se ?????. ? afa??es? t??
p?s?? ap? t?? p??t? p??pe? ?a s???de?eta? ap? t??
p??s?es? t?? p?s?? st? de?te??. ?? t? afa????µe??
p?s? d?af??e? ap? t? p??st???µe??, t?te ta
ded?µ??a t?? ß?s?? de? ????? s???pe?a (de? e??a?
????).
11?ef??a?? 15 ??a?e???s? S??a??a???
???p?? epe?e??as?a?
- ????????a?? ? se???a?? e?t??es?
- ?p?? ?? s??a??a??? e?te????ta? ? µ?a µet? t??
???? a??? eµfa?????ta? s?µa?t???? ?a??ste??se??
µe ap?t??esµa ?a µe???eta? ? ?e???? ap?d?s? t??
s?st?µat??. - ?a?t?????? e?t??es? p????? s??a??a???
- ?p?? ? d?s??? ? ? CPU µp????? ?a apas??????ta? µe
???? s??a??a??, ?p?te a????eta? ? a???µ?? t??
s??a??a??? p?? ???????????ta? st? µ???da t??
?????? (throughput). - ??e????t?µa µe?????ta? ?? ?a??ste??se?? (waiting
time) ?a? ? µ?s?? ?????? e?t??es?? t?? s??a??a???
(mean response time). - ?e?????t?µa e?d??eta? ?a ep?f??e? p??ß??µata
st?? a?e?a??t?ta ?a? s???pe?a t?? ded?µ???? t??
??.
12?ef??a?? 15 ??a?e???s? S??a??a???
??e???? ta?t??????sµ??
- ? s?st?? s??t???sµ?? t?? s??a??a??? e??a? e?????
t?? S???, t? ?p??? µ?s? t?? µ??a??sµ?? e??????
ta?t??????sµ?? e????ta? t?? ?µa?? e?t??es? t??
s??a??a???. - ? t??p?? s??t???sµ?? ?a? e?t??es?? e??? s??????
s??a??a??? ?a?e?ta? ?????d????aµµa (schedule). - ?? S??? p??pe? ?a ep????e? ??a ?????d????aµµa p??
?a ??a??p??e? t?? apa?t?se?? s???pe?a? t??
ded?µ????.
13?ef??a?? 15 ??a?e???s? S??a??a???
?a?ade??µata ?????d?a??aµµ?t??
14?ef??a?? 15 ??a?e???s? S??a??a???
Se???a?? ?????d????aµµa
- Se ??a se???a?? (serial) ?????d????aµµa ??
e?t???? µ?a? s??a??a??? de? pe??p?????ta? ???????
µe e?t???? t?? ????? s??a??a???.
15?ef??a?? 15 ??a?e???s? S??a??a???
Se???a?? ?????d????aµµa
- ?p?????? n! d??at? se???a?? ?????d?a???µµata
e?t??es?? ??a n s??a??a???. - ? t??p?? e?t??es?? t?? s??a??a??? ????eta? ap? t?
µ???d? ?????d??µ?????s?? p?? ???s?µ?p??e? t?
?e?t??????? s?st?µa ?a? ep?µ???? de? µp????µe ?a
????????µe µe a???ße?a t? ????? e?t??es?? t??
???e e?t???? µ?a? s??a??a???.
16?ef??a?? 15 ??a?e???s? S??a??a???
Se????p???s?
- G?a ?a d?at??e? t? s???pe?a t?? ded?µ???? t?? ??
?a p??pe? t? ?????d????aµµa e?t??es?? s??a??a???
?a e??a? ?s?d??aµ? µe ??p??? se???a??
?????d????aµµa. - ??? ?????d?a???µµata ?a????ta? ?s?d??aµa a? µet?
t?? e?t??es? t??? ep?f????? t?? ?d?e? a??a??? st?
??. - ? pa?a???? e??? ?????d?a???µµat?? ?s?d??aµ?? µe
??a se???a?? ?????d????aµµa ?a?e?ta? se????p???s?
(serializability) ?a? ??e? d?? µ??f?? - se????p???s? s??????s?? (conflict), ?a?
- se????p???s? ???? (view).
17?ef??a?? 15 ??a?e???s? S??a??a???
Se????p???s? s??????s??
- ?st? ?????d????aµµa S ?a? d?? ??????? s??e??µe?e?
e?t???? Ei, Ej (p?? a?af????ta? sta ?d?a
ded?µ??a D) t?? s??a??a??? S1, S2, a?t?st?????. - ??a??????µe t?? e??? pe??pt?se??
- Ei read(D) ?a? Ej read(D)
- Ei read(D) ?a? Ej write(D)
- Ei write(D) ?a? Ej read(D)
- Ei write(D) ?a? Ej write(D)
- ?? t??????st?? µ?a e?t??? e??a? e?t???
ap????e?s??, t?te ?? e?t???? Ei ?a? Ej ß??s???ta?
se s??????s?
18?ef??a?? 15 ??a?e???s? S??a??a???
Se????p???s? s??????s??
- ?? ??a ?????d????aµµa e?t??es?? S µp??e? ?a
µetas??µat?s?e? se ??a ???? ?????d????aµµa S'
a???-???ta? t? se??? e?t??es?? t?? e?t????, t?te
ta S ?a? S' ?a????ta? ?s?d??aµa ?? p??? t??
s??????se??. - ?? ?????d????aµµa S ?a?e?ta? se????p???s?µ? ??
p??? t?? s??????se?? (conflict serializable) a?
e??a? ?s?d??aµ? ?? p??? t?? s??????se?? µe ??a
se???a?? ?????d????aµµa.
19?ef??a?? 15 ??a?e???s? S??a??a???
Se????p???s? s??????s?? ?a??de??µa
20?ef??a?? 15 ??a?e???s? S??a??a???
Se????p???s? s??????s?? ??t?pa??de??µa
21?ef??a?? 15 ??a?e???s? S??a??a???
Se????p???s? ????
- ?st? d?? ?????d?a???µµata S ?a? S? µe ta ?d?a
s????a s??a??a???. ?a S ?a? S? ???µ????ta?
?s?d??aµa a? ??a ???e st???e?? ded?µ???? D - a? ? s??a??a?? Si d?aß??e? t?? a????? t?µ? t?? D
st? ?????-d????aµµa S, t?te p??pe? ? s??a??a?? Si
ep?s?? ?a d?aß??e? t?? a????? t?µ? t?? D st?
?????d????aµµa S?, - a? ? s??a??a?? Si e?te?e? t?? e?t??? Read(D) st?
?????d??-??aµµa S ?a? a?t? ? t?µ? ??e? pa?a??e?
ap? t? s??a??a?? Sj, t?te ? Si p??pe? ep?s?? ?a
d?aß?se? t?? t?µ? p?? pa???e? ? Sj st?
?????d????aµµa S?, - ? s??a??a?? p?? e?te?e? t?? te?e?ta?a e?t???
Write(D) st? ?????d????aµµa S, p??pe? ?a? st?
?????d????aµµa S' ?a e?te?e? t?? te?e?ta?a
e?t??? Write(D).
22?ef??a?? 15 ??a?e???s? S??a??a???
Se????p???s? ????
- ??a ?????d????aµµa S ?a?e?ta? se????p???s?µ? ??
p??? t?? ??? (view serializable) a? e??a?
?s?d??aµ? ?? p??? t?? ??? µe ??p??? se???a??
?????d????aµµa.
23?ef??a?? 15 ??a?e???s? S??a??a???
???a??sµ?? ??e?d?µat??
- ? ??e?da??? (lock) a?t?st???e? se ??a tµ?µa
ded?µ???? ?a? e??a? µetaß??t? p?? pe?????fe? t??
?at?stas? t?? tµ?µat?? t?? ded?µ???? se s??s? µe
t?? ?e?t?????e? p?? e?e????? sta s???e???µ??a
ded?µ??a.
24?ef??a?? 15 ??a?e???s? S??a??a???
???a??sµ?? ??e?d?µat??
- ??? e??a? ?? ßas???? t?p?? ??e?da????
- ??e?da??? a?????s?? (read) ? ??e?da???
d?aµ???asµ?? (share), p?? ep?t??pe? se µ?a
s??a??a?? ?a d?aß?se? ta ded?µ??a a??? ??? ?a ta
e??µe??se? ? ?a ta d?a????e?, - ??e?da??? ap????e?s?? (write) ? ap???e?st???
??e?da??? (exclusive), p?? ep?t??pe? se µ?a
s??a??a?? ?a d?aß?se? ? ?a e??µe??se? ta
ded?µ??a.
25?ef??a?? 15 ??a?e???s? S??a??a???
???a??sµ?? ??e?d?µat?? ?
- ? µ??a??sµ?? ??e?da???? ?e?t????e? ?? e???
- µ?a s??a??a?? p?? af??? a?????s? ded?µ????, ??t?
?a t?? ???????e? µ?a ??e?da??? a?????s??, - a? apa?te?ta? e??µ???s? ded?µ????, t?te ??t? µ?a
??e?da??? ap????e?s??, - a? de? ?p???e? ???? ??e?da??? ??a t? s???e???µ???
se??da ded?µ????, t?te ? ??e?da??? ?????e?ta? st?
s??a??a??, - a? ?p???e? ?d? ???? ??e?da??? p?? ??e? ???????e?
se ???? s??a??a??, t?te p?a?µat?p??e?ta? ??e????
??a t? a? ?a ???????e? ? ??e?da??? st? ??a
s??a??a?? ? ???.
26?ef??a?? 15 ??a?e???s? S??a??a???
???a??sµ?? ??e?d?µat?? ??
- a? ? se??da ded?µ???? ??e? ??e?d??e? µe ???s?
??e?da???? a?????s?? ?a? ? ??a s??a??a?? ??t?
ep?s?? ??e?da??? a?????s??, t?te t? s?st?µa
ep?t??pe? t? ??????s? t?? ??e?da????. - Se d?af??et??? pe??pt?s? ? ??a s??a??a?? p??pe?
?a pe??µ??e? µ???? ? p??????µe?? s??a??a??
????????se? t?? e??as?a µe t? se??da ded?µ????
?a? ape?e??e??se? t?? ??e?da???. - µ?a s??a??a?? ape?e??e???e? t?? ??e?da??? ?ta? ?
e?t??es? t?? ?????????e? e?te µe ep?t???a e?te µe
ap?t???a. - ?? µ???µe? a??a??? sta ded?µ??a e??a? ??at?? ap?
t?? ?p????pe? s??a??a??? µ??? µet? t??
ape?e?????s? t?? ??e?da???? ap????e?s?? ap? t?
s??a??a??.
27?ef??a?? 15 ??a?e???s? S??a??a???
???a??sµ?? ??e?d?µat?? ???
- µ?a s??a??a?? p?? p??pe? ?a e??µe??se? ??p??a
ded?µ??a µp??e? ?a ??t?se? a?aß??µ?s? (upgrade)
t?? ??e?da???? ap? ??e?da??? a?????s?? se
??e?da??? ap????e?s??. - a? ? e???af? t?? ded?µ???? ??e? ?????????e? a???
? s??a??a?? de? ??e? ????????se? t?? a?????s? t??
ded?µ????, t?te µp??e? ?a ??t?se? ?p?ß??µ?s?
(downgrade) t?? ??e?da???? ap? ap????e?s?? se
a?????s??.
28?ef??a?? 15 ??a?e???s? S??a??a???
???a??sµ?? ??e?d?µat?? ??t?pa??de??µa
29?ef??a?? 15 ??a?e???s? S??a??a???
???t?????? ??e?d?µat??
- ??a? µ??a??sµ?? ??e?d?µat?? p??pe? ?a ??a??p??e?
?a???e? e????s?? t?? s???pe?a? t?? ded?µ????. - ?? ?a???e? a?t?? ??????? ??a p??t??????
??e?d?µat?? (locking protocol) ?a? e?????ta? ?t?
t? ?????d????aµµa p?? p????pte? e??a?
se????p???s?µ?. - ???t?????? ??e?d?µat?? ??? F?se?? (two-phase
locking) - f?s? a??pt???? (growing phase), ?p?? ? s??a??a??
??t? t? ??????s? ??e?da???? ?a? de? ep?t??peta? ?
ape?e?????s? ??e?da????, - f?s? s???????s?? (shrinking phase), ?p?? ?
s??a??a?? ape?e??e???e? ??e?da???? ?a? de?
ep?t??peta? ?a ??t?se? t? ??????s? ????
??e?da????.
30?ef??a?? 15 ??a?e???s? S??a??a???
???t?????? ??e?d?µat?? d?? f?se??
31?ef??a?? 15 ??a?e???s? S??a??a???
???t?????? ??e?d?µat?? d?? f?se??
32?ef??a?? 15 ??a?e???s? S??a??a???
???t?????? ??e?d?µat?? ßas?sµ??? se ???f?
- ?ta? e??a? ???st? ? se??? p??spe??se?? t??
ded?µ???? ap? t? s??a??a?? ???s?µ?p??e?ta? t?
p??t?????? ??e?d?µat?? ßas?sµ??? se ???f?. - ?st? Dd1,d2,,dn ??a s????? n ded?µ???? p??
p??spe?a????ta? ap? t?? s??a??a??? e?te ??a
a?????s? e?te ??a ap????e?s?. - ??????µe µ?a µe???? d??ta?? st? s????? D ?? e???
- ta ded?µ??a di ?a? dj s??d???ta? µe t? s??s? ? a?
???e s??a??a?? p?? p??spe?a??e? ta di ?a? dj
p??spe?a??e? t? di p??? ap? t? dj. - ? µe???? d??ta?? ep?t??pe? t?? a?apa??stas? t??
s?????? ?? ?ate?????µe?? ?????? ???f? (dag).
33?ef??a?? 15 ??a?e???s? S??a??a???
???t?????? ??e?d?µat?? ßas?sµ??? se ???f?
- ??d??? pe??pt?s? t?? ?ate?????µe??? ???????
???f?? e??a? ? de?d????? ???f??, ?p?? efa?µ??eta?
t? de?d???? p??t?????? (tree protocol) p??
?p?st????e? µ??? ??e?da???? a?????s??.
34?ef??a?? 15 ??a?e???s? S??a??a???
?e?d???? p??t??????
- ?? de?d???? p??t?????? ??e? t??? e??? ?a???e?
- ? ???e s??a??a?? µp??e? ?a ??t?se? ??????s? t??
p??t?? ??e?da???? se ?p???d?p?te ded?µ???, - µ?a s??a??a?? µp??e? ?a ??t?se? t? ??????s?
??e?da???? st? ded?µ??? dj µ??? a? ??e? ?d?
??e?d?se? t? ded?µ??? di ?a? ?s??e? di ? dj - µ?a s??a??a?? µp??e? ?a ape?e??e??se? µ?a
??e?da??? ?p??ad?p?te ??????? st??µ?, - ??a ded?µ??? p?? ??e? ??e?d??e? ap? µ?a s??a??a??
?a? st? s????e?a ? ??e?da??? ??e? ape?e??e???e?,
de? ep?t??peta? ?a ??e?d??e? ??a de?te?? f??? ap?
t? ?d?a s??a??a??.
35?ef??a?? 15 ??a?e???s? S??a??a???
?e?d???? p??t??????
- ?a??de??µa pa?aß?as?? t?? 2?? ?a???a
36?ef??a?? 15 ??a?e???s? S??a??a???
??a?e???s? ad?e??d??
- ??a s????? s??a??a??? ß??s?eta? se ad????d?
(deadlock), ?ta? ?aµ?a s??a??a?? de? e??a? ef??t?
?a s??e??se? t?? e?t??es? t??, ???? a?aµ???? ??a
t?? ape?e?????s? ??e?da????. - ?? ad????d? ap?te?e? pa???????? ?at?stas? ?a?
p??pe? ?a ap?fe??eta?.
37?ef??a?? 15 ??a?e???s? S??a??a???
??a?e???s? ad?e??d??
- ? d?a?e???s? t?? ad?e??d?? p?a?µat?p??e?ta?
?e???? µe d?? µe??d??? - ap?f??? ad?e??d?? (deadlock prevention), ?p?? t?
s?st?µa e????e? t?? p??a??t?ta ?a s?µße? ad????d?
?a? p??spa?e? ?a t? ap?f??e? (p??te??eta? ?ta?
s?µßa????? p???? ad????da), - a?a?????s? ad?e??d?? ?a? epa???t?s? (deadlock
detection and recovery) ?p?? t? s?st?µa e??a? se
??s? ?a a?a?????se? ??a ad????d? ?a? p??ßa??e? se
e????e?e? ??a t?? ?at????s? t?? (p??te??eta? ?ta?
de? s?µßa????? p???? ad????da).
38?ef??a?? 15 ??a?e???s? S??a??a???
?p?f??? ad?e??d??
- ??a µ???d?? ap?f???? t?? ad?e??d?? e??a? ?
???sµ?? e??? µ???st?? ???????? d?ast?µat?? ??a
t?? a?aµ??? ??????s?? µ?a? ??e?da????. - ?? e?a?t???e? t? ??????? d??st?µa ?a? ? ??e?da???
de? ??e? a??µ? ???????e? st? s??a??a??, t?
s?st?µa te?µat??e? t? d?ad??as?a ?a? t??
epa?ad?µ?????e?. - ? µ???d?? a?t? ap?f???? ad?e??d?? ???s?µ?p??e?ta?
ap? p???? S??? ???? t?? ap??t?t?? t??.
39?ef??a?? 15 ??a?e???s? S??a??a???
?p?f??? ad?e??d??
- ??a ???? µ???d?? e??a? a?t? t?? ????????
sf?a??d?? (timestamps) ?a? p??te????ta? d??
a??????µ?? - Wait-Die, p?? ep?t??pe? se µ?a pa?a??te??
s??a??a?? (µ???? ??????? sf?a??da) ?a pe??µ??e?
t?? ape?e?????s? µ?a? ??e?da???? ap? µ?a ?e?te??
(µe?a??te?? ??????? sf?a??da). ??af??et???,?
s??a??a?? te?µat??eta? ?a? t? s?st?µa t??
epa?e????e?. - Wound-Wait, ?p?? ep?t??peta? se µ?a ?e?te??
s??a??a?? ?a pe??µ??e? t?? e?t??es? µ?a?
pa?a??te???. ?? ? pa?a??te?? s??a??a?? ??t? t?
??????s? µ?a? ??e?da???? p?? e??a? desµe?µ??? ap?
µ?a ?e?te?? s??a??a??,t?te ? ?e?te?? s??a??a??
te?µat??eta?.
40?ef??a?? 15 ??a?e???s? S??a??a???
??a?????s? ?a? ?at????s? ad?e??d??
- ? a?a?????s? ad?e??d?? se ??a s????? s??a??a???
d?ap?st??eta? µe t? ß???e?a e??? ?ate?????µe???
???f?? p?? ?a?e?ta? ???f?? a?aµ???? (wait graph) - ? ???f?? a?t?? ap?te?e?ta? ap? ??a s????? ????f??
V ?a? ??a s????? a?µ?? E. G?a ???e s??a??a??
?p???e? ?a? µ?a a?t?st???? ????f? st? ???f?. - ?? ?p???e? a?µ? ap? t?? ????f? Si p??? t??
????f? Sj, t?te a?t? d????e? ?t? ? s??a??a?? Si
a?aµ??e? µ???? ? s??a??a?? Sj ?a ape?e??e??se?
t?? ??e?da??? se ??a tµ?µa ded?µ???? p?? p??pe?
?a p??spe??se? ? Si.
41?ef??a?? 15 ??a?e???s? S??a??a???
??a?????s? ?a? ?at????s? ad?e??d??
- ?? st? ???f? a?aµ???? de? ?p???e? ??????, t?te
de? ?p???e? ad????d?. ??t??eta, ? ?pa??? ?st? ?a?
e??? ?????? s?µa??e? ?t? ??a ?p?s????? t??
s??a??a??? ß??s?eta? se ad????d?. - ?? s?µßa????? s???? ad????da p??pe? ?a e??a?
s????? ?a? ? ??e???? t?? ???f?? a?aµ????. - ?? S??? µp??e? ?a d?at??e? stat?st??? st???e?a
??a t?? a???µ? t?? ad?e??d?? ?a? t? s????t?ta
eµf???s?? t??? ?a? a?????a ?a p??sd?????eta? ?a?
? s????t?ta t?? e?????? ??a ad????d?.
42?ef??a?? 15 ??a?e???s? S??a??a???
??a?????s? ?a? ?at????s? ad?e??d??
43?ef??a?? 15 ??a?e???s? S??a??a???
?at????s? ad?e??d??
- ? s????te?a ???s?µ?p????µe?? µ???d?? ??a t??
?at????s? t?? ad????d?? e??a? ? te?µat?sµ?? µ?a?
? pe??ss?t???? s??a??a??? ?a? ? epa?af??? t??
ded?µ???? st?? ?at?stas? p?? ß??s??ta? p??? ap?
t?? e?t??es? t?? s??a??a??? a?t?? (ROLLBACK).
44?ef??a?? 15 ??a?e???s? S??a??a???
?at????s? ad?e??d??
- ? µ???d?? ROLLABACK e?te?e?ta? ?? e???
- ??µa 1. ?p????? s??a??a??? ??a ROLLABACK. H
ep????? t?? s??a??a??? p?a?µat?p??e?ta? µe ß?s?
t? e????st? ??st??. S?µf??a µe t??? e???
pa?????te? - ? µ???? st??µ?? ?????? e?t??es?? t?? s??a??a???
?a? ? ?p??e?p?µe??? ?????? ??a t?? ????????s? t??
s??a??a???, - ? a???µ?? t?? ded?µ???? p?? ????? e??µe???e? ap?
t? s??a??a??, - ? a???µ?? t?? ded?µ???? p?? p??pe? ?a
p??spe?as???? ap? t? s??a??a??, - ? a???µ?? t?? s??a??a??? ?p?? ?a efa?µ?s?e? ?
?e?t?????a ROLLBACK.
45?ef??a?? 15 ??a?e???s? S??a??a???
?at????s? ad?e??d??
- ??µa 2. ?p????? s?µe??? ROLLBACK.
- ? ap???ste?? ??s? e??a? ?a ???e? epa?af??? t??
s??a??a??? st?? a???, ?ata????ta? ??e? t??
a??a??? p?? ??e? ep?f??e? sta ded?µ??a, - ? ??s? a?t? ??e? µe???? ??st??, d??t? ? s??a??a??
µp??e? ?a ??e? e??µe??se? ??a µe???? a???µ?
ded?µ????, - s??????, t? ad????d? ?ata??e?ta? efa?µ????ta?
ROLLBACK st?? te?e?ta?e? e?t???? t?? s??a??a???.
46?ef??a?? 15 ??a?e???s? S??a??a???
?at????s? ad?e??d??
- ??µa 3. ?p?f??? at??µ???? a?aµ????.
- ? at??µ??? a?aµ??? (starvation) e??a? ??a
fa???µe?? p?? µp??e? ?a eµfa??s?e? a? ep????eta?
s??e??? ? ?d?a s??a??a?? ??a t?? efa?µ??? t??
ROLLBACK, - a?t? s?µa??e? ?t? s??e??? ? ?d?a s??a??a??
eµp?d??eta? ?a ????????se? t?? e?t??es? t??, - t? S??? µp??e? ?a ap?t???e? t?? ep????? t?? ?d?a?
s??a??a??? pe??ss?te?? ap? ??a? a???µ? ep??????,
d????ta? ?ts? t?? e??a???a st? s??a??a?? ?a
????????se? t?? epe?e??as?a t??.
47?ef??a?? 15 ??a?e???s? S??a??a???
???a??sµ?? ???????? sf?a??d??
- ? µ??a??sµ?? ???????? sf?a??d?? de? ???s?µ?p??e?
??e?da???? ??a t?? p??stas?a µ?a? pe??????
ded?µ????, ??a de? ?p???e? pe??pt?s? ?a
d?µ???????e? ad????d?. - ? ??????? sf?a??da e??a? µ?a µetaß??t? p??
p??sd??-???e? t? ??????? st??µ? t?? a???? t??
e?t??es?? µ?a? s??a??a???. - ??a ??????? sf?a??da pa???eta? e?te ap? t? ?????
t?? s?st?µat?? e?te e??µe?????ta? t?? t?µ? µ?a?
µetaß??-t?? ???e f??? p?? d?µ?????e?ta? µ?a ??a
s??a??a??. - ? ??????? sf?a??da t?? s??a??a??? Si s?µß????eta?
µe TS(Si).
48?ef??a?? 15 ??a?e???s? S??a??a???
???a??sµ?? ???????? sf?a??d??
- ? p??sp??as? ep?t??peta? µ??? a? ? te?e?ta?a
e??µ?-??s? p?a?µat?p??????e ap? pa?a??te??
s??a??a?? (p?? ?a ??e? µ????te?? ???????
sf?a??da). - ?????? p?a?µat?p??e?ta? te?µat?sµ?? ?a?
epa?e?????s? t?? s??a??a??? µe ??a ???????
sf?a??da. - ???????? sf?a??de? ??????ta? ??? µ??? ??a t??
s??a??a-??? a??? ?a? ??a ta ded?µ??a - se ???e se??da ded?µ???? a?t?st???e? µ?a ???????
sf?a??da a?????s?? ?a? µ?a ??????? sf?a??da
ap????e?s??, - ?? d?? ???????? sf?a??de? s?µß??????ta? µe
timestamp-W ?a? timestamp-R a?t?st???a.
49?ef??a?? 15 ??a?e???s? S??a??a???
???a??sµ?? ???????? sf?a??d??
- ? t?µ? t?? ???????? sf?a??da? a?????s?? e??a? ?
t?µ? t?? ???????? sf?a??da? t?? s??a??a??? p??
p?a?µat?p???se te?e?ta?a a?????s? st? se??da
ded?µ????. - ? t?µ? t?? ???????? sf?a??da? ap????e?s?? e??a?
? ??????? sf?a??da t?? s??a??a??? p??
p?a?µat?p???se te?e?ta?a e??µ???s? st? se??da
ded?µ????. - ???e f??? p?? p?a?µat?p??e?ta? a?????s? ?
ap???-?e?s? t?? se??da? ded?µ???? D,
e??µe?????ta? ?? t?µ?? timestamp-W(D) ?a?
timestamp-R(D), a?t?st?????.
50?ef??a?? 15 ??a?e???s? S??a??a???
???t?????? d??ta??? ???????? sf?a??d??
51?ef??a?? 15 ??a?e???s? S??a??a???
???t?????? d??ta??? ???????? sf?a??d??
52?ef??a?? 15 ??a?e???s? S??a??a???
?a???a? ap????e?s?? t?? Thomas
- ?e t? ???s? t?? µe??d?? t?? ???????? sf?a??d?? a?
µ?a s??a??a?? p??spa??se? ?a a????e? t?? t?µ?
µ?a? se??da? ded?µ????, ? ?p??a ??e? ?d?
e??µe???e? ap? ???? s??a??a??, t?te ? e?t??es?
t?? s??a??a??? d?a??pteta? ?a? p?a?µat?p??e?ta?
ROLLBACK. - S?µf??a µe t?? ?a???a ap????e?s?? t?? Thomas
a??e? ?a a????s??µe t? ?e?t?????a ap????e?s??,
?p?te - µe???eta? t? ??st?? ?e?t?????a?, ?a?
- a????eta? ? ap?d?s? t?? s?st?µat??.
53?ef??a?? 15 ??a?e???s? S??a??a???
?a???a? ap????e?s?? t?? Thomas
54?ef??a?? 15 ??a?e???s? S??a??a???
?a???a? ap????e?s?? t?? Thomas
- ?? ??? p??t?????? d?af??e? µ??? ?? p??? t?
d?a?e???s? t?? e?t???? ap????e?s?? - a? TS(Si) lt timestamp-W(D), t?te ? s??a??a??
p??spa?e? ?a e??µe??se? µ?a t?µ? p?? ??e? ?d?
a????e? ap? ???? s??a??a??. St?? pe??pt?s? a?t? ?
e?t??? ap????e?s?? µp??e? ?a a?????e? µe
asf??e?a. - a? TS(Si) lt timestamp-R(D),
- t?te ? t?????sa t?µ? t?? D d?aß?s???e
p??????µ???? ap? ???? s??a??a??. St?? pe??pt?s?
a?t? d?a??pteta? ? e?t??? ap????e?s?? ?a?
p?a?µat?p??e?ta? ROLLBACK. - a? de? ?s??e? ?aµ?a ap? t?? d?? s?????e?,
- t?te ? ?e?t?????a ap????e?s?? µp??e? ?a
?????????e? ????? p??ß??µa ?a? timestamp-W(D)
TS(Si).
55?ef??a?? 15 ??a?e???s? S??a??a???
?pa???t?s? ded?µ????
- ?? s????te?e? a?t?e? p?? ?d????? se d?a??p? t??
?e?t?????a? t?? s?st?µat?? e??a? - pt?s? s?st?µat??, ???? esfa?µ???? ?e?t?????a? t??
?????? ? t?? ????sµ???? s?st?µat??, - p??ß??µa st? µ?s? ap????e?s??, t? ?p??? µp??e? ?a
?fe??eta? se ?atast??f? t?? µa???t???? ep?f??e?a?
t?? d?s???, t?? µ??a????? ? t?? ??e?t???????
?????? t?? d?s???, - sf??µa ????sµ???? efa?µ????, t? ?p??? ?fe??eta?
s?????? se sf??µa e?t??es?? (run-time error) ?at?
t? d????e?a e??µ???s?? t?? ded?µ???? t?? ??, - f?s??? a?t?a, ?p?? p???a????, se?sµ?? ??p.
56?ef??a?? 15 ??a?e???s? S??a??a???
?pa?t?se?? epa???t?s?? ded?µ????
- G?a ?a e??a? ef??t? ? ?e?t?????a t?? epa???t?s??
ded?µ????, t? S??? p??pe? ?a d?a??te? - µ??a??sµ? d?µ??????a? a?t????f?? asfa?e?a?
(backup) ??a ta ded?µ??a t?? ??, - ?ata??af? ?µe???????? (log) ?p?? ?a ap????e?eta?
? ?at?stas? t?? ???e s??a??a??? ?a? ?? a??a???
p?? ????? p?a?µat?p????e? st? ??, - µ??a??sµ? ???????? s?µe??? e?????? (checkpoints)
p?? s?µat?d?t??? t?? st??µ?? p?? ?? a??a??? p??
????? ep?f??e? ?? s??a??a??? ????? ???e? µ???µe?, - µ???d? epa???t?s??, ? ?p??a ?aµß????ta? ?p??? ta
a?t???afa asfa?e?a?, t?? p????f???e? ?µe????????
?a? ta ??????? s?µe?a e??????, epa?af??e? t? ??
se ?at?stas? s???pe?a?.