Failure Recovery: Undo and Redo Logging for Database Consistency, Slides of Database Management Systems (DBMS)

The importance of data integrity in databases and the role of undo and redo logging in maintaining consistency. It covers concepts such as consistent states, constraints, and transaction execution, as well as potential causes of inconsistencies and methods for prevention and recovery. The document also touches upon the difference between undo and redo logging and their respective rules.

Typology: Slides

2012/2013

Uploaded on 04/26/2013

parina
parina 🇮🇳

4.4

(67)

222 documents

1 / 37

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Failure Recovery
Introduction
Undo Logging
Redo Logging
1
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25

Partial preview of the text

Download Failure Recovery: Undo and Redo Logging for Database Consistency and more Slides Database Management Systems (DBMS) in PDF only on Docsity!

Failure Recovery

Introduction Undo Logging Redo Logging

Integrity or correctness of data

  • Would like data to be “accurate” or “correct” at all times

EMP

2

Name White Green Gray

Age 52 3421 1

Definition:

  • Consistent state: satisfies all constraints
  • Consistent DB: DB in consistent state

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

Constraints ( as we use here) may not capture “full correctness”

Example 2 Database should reflect real world

7

DB

Reality

in any case, continue with constraints...

Observation: DB cannot be consistent always! Example: a 1 + a 2 +…. an = TOT ( constraint ) Deposit $100 in a 2 : a 2 ← a 2 + 100 TOT ← TOT + 100

Transaction: collection of actions that preserve consistency

10

Consistent DB T Consistent DB’

Big assumption:

If T starts with consistent state + T executes in isolation ⇒ T leaves consistent state

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

How can we prevent/fix violations?

  • Chapter 17: due to failures only
  • Chapter 18: due to data sharing only
  • Chapter 19: due to failures and sharing

Chapter 17: Recovery

  • First order of business: Failure Model

Events Desired

Undesired Expected Unexpected

Desired events: see product manuals….

Undesired expected events: System crash

  • memory lost
  • cpu halts, resets

19

Undesired Unexpected: Everything else!

that’s it!!

Examples:

  • Disk data is lost
  • Memory lost without CPU halt
  • CPU implodes wiping out universe….

20

Undesired Unexpected: Everything else!