
DBDI
Lecture 13_DB Recovery 1
Ala Al-Zobaidie
DBDI / Lecture 13
Database Recovery
The slides are based on the textbook Fundamentals of Database Systems by
Elmasri & Navathe
30/05/2007 DBDI 2
Lecture - Objectives
• Recovery Control
– Some causes of database failure.
– Purpose of transaction log file.
– Purpose of Checkpointing.
– How to recover from DB failure.
• Cashing and Flashing
• Deferred & Immediate updates
• Shadowing technique.
30/05/2007 DBDI 3
Database Recovery
• The restoration of a Database to a
consistent state after system failure.
• DBA should ensure that a complete copy
of the DB is stored at regular intervals in
an archive file (Periodic full backups).
• DB can be restored to a consistent and
up-to-date state using these archives.
30/05/2007 DBDI 4
Why Recovery Control
•Two types of storage:
Volatile (main memory) and Nonvolatile.
•Volatile storage
•does not survive system crashes.
•Stable storage
•represents information that has been
replicated in several nonvolatile storage
media with independent failure modes.
30/05/2007 DBDI 5
Types of Failures
• System crashes
– resulting in loss of main memory.
• Media failures
– resulting in loss of parts of secondary storage.
• Application software errors.
– Transaction Failures
– Transaction aborts due to software bugs, or deadlocks
– Average of 3% of transactions abort abnormally (not user-
intended)
• Natural physical disasters.
• Carelessness or unintentional destruction of
data or facilities.
• Sabotage.
30/05/2007 DBDI 6
Transactions & Recovery /1
• Transactions represent basic unit of
recovery.
• Recovery Manager (RM) responsible for
Atomicity and Durability.
• If failure occurs between Commit and
Flushing then,
to ensure Durability, RM has to Redo
(RollForward) transaction’s updates.