Notes08 - CS245:DatabaseSystem Principles...

Info iconThis preview shows pages 1–16. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 245 Notes 08 1 CS 245: Database System  Principles Notes 08: Failure Recovery Steven Whang
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 08 2 PART II Crash recovery (1 lectures)       Ch.17[17] Concurrency control (2 lectures)       Ch.18[18] Transaction processing (1 lect)       Ch.19[19] Information integration (1 lect)       Ch.20[21,22] Entity resolution (1 lect)
Background image of page 2
CS 245 Notes 08 3 Integrity or correctness of data Would like data to be “accurate” or “correct” at all times        EMP Name White Green Gray Age 52 3421 1
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 08 4 Integrity or consistency constraints Predicates data must satisfy Examples: - x is key of relation R - x   y holds in R - Domain(x) = {Red, Blue, Green} is valid index for attribute x of R - no employee should make more than twice the average salary
Background image of page 4
CS 245 Notes 08 5 Definition: Consistent state:  satisfies all constraints Consistent DB:  DB in consistent state
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 08 6 Constraints  ( as we use here)  may  not  capture “full correctness” Example 1    Transaction constraints When salary is updated,  new salary >  old salary When account record is deleted, balance = 0
Background image of page 6
CS 245 Notes 08 7 Note:  could be “emulated” by simple constraints, e.g.,  account Acct # …. balance deleted?
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 08 8 Example 2      Database should reflect real world DB Reality Constraints  ( as we use here)  may  not  capture “full correctness”
Background image of page 8
CS 245 Notes 08 9 in any case, continue with constraints. .. Observation:   DB cannot  be consistent  always! Example:  a 1  + a 2  +…. a n  = TOT ( constraint ) Deposit $100 in  a 2 :   a 2      a 2  + 100 TOT     TOT + 100
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 08 10     a 2      TOT . . 50 . . 1000 . . 150 . . 1000 . . 150 . . 1100 Example:  a 1  + a 2  +…. a n  = TOT ( constraint ) Deposit $100 in  a 2 :   a 2      a 2  + 100 TOT     TOT + 100
Background image of page 10
CS 245 Notes 08 11 Transaction:   collection of actions  that preserve consistency     Consistent DB Consistent DB’ T
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 08 12 Big assumption: If T starts with consistent state +       T executes in isolation  T leaves consistent state
Background image of page 12
CS 245 Notes 08 13 Correctness    (informally) If we stop running transactions, DB left consistent Each transaction sees a consistent DB
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
CS 245 Notes 08 14 How can constraints be violated? Transaction bug DBMS bug Hardware failure e.g., disk crash alters balance of account Data sharing e.g.: T1: give 10% raise to programmers           T2: change programmers   systems analysts
Background image of page 14
CS 245 Notes 08 15 How can we prevent/fix  violations?
Background image of page 15

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 16
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 62

Notes08 - CS245:DatabaseSystem Principles...

This preview shows document pages 1 - 16. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online