CS 632 Lecture 6 - PowerPoint PPT Presentation

About This Presentation
Title:

CS 632 Lecture 6

Description:

LSN (Log Sequence Number) unique id for each log record. Type. type of ... LSN of the previous log record written by the same. transaction that wrote the record ... – PowerPoint PPT presentation

Number of Views:26
Avg rating:3.0/5.0
Slides: 24
Provided by: cristiani
Category:
Tags: lecture | lsn

less

Transcript and Presenter's Notes

Title: CS 632 Lecture 6


1
CS 632 Lecture 6 Recovery
Principles of Transaction-Oriented Database
Recovery Theo Haerder, Andreas Reuter, 1983
ARIES A Transaction Recovery Method Supporting
Fine-Granularity Locking and Partial Rollbacks
Using Write-Ahead Logging C. Mohan, Don
Haderle, Bruce Lindsay, Hamid Piralesh, and
Peter Schwartz, 1992
2
Principles of Transaction-Oriented Database
Recovery
  1. DATABASE RECOVERY WHAT IT IS EXPECTED TO DO
  2. What Is a Transaction
  3. Which Failures Have To Be Anticipated
  4. Summary of Recovery Actions
  5. THE MAPPING HIERARCHY OF A DBMS
  6. The Mapping Process
  7. The Storage Hierarchy
  8. Different Views of a Database
  9. Mapping Concepts for Updates
  10. CRASH RECOVERY
  11. Dependencies Between Buffer Management and
    Recovery Component
  12. Classification of Log Data
  13. Checkpoints
  14. ARCHIVE RECOVERY

3
  • What is a transaction?
  • actions executed indivisibly
  • four properties required (the ACID properties)
  • Atomicity
  • all actions in the transaction happen, or none
    happen
  • Consistency
  • if a transaction preserves the consistency of the
    DB
  • Isolation
  • execution of one transaction is isolated from
    that of other transactions
  • Durability
  • if a transaction commits, its effects persist

4
Which Failures Have to Be Anticipated?
  • Transaction Failures
  • caused by bad input or other violations of
    consistency
  • System Failures
  • caused by
  • bugs in the DBMS code
  • operating system fault
  • hardware failure
  • occur less frequently
  • Media Failures
  • caused by
  • software errors
  • hardware errors
  • physical errors

5
Summary of Recovery Actions
  • Transaction Undo
  • when a transaction aborts itself
  • Global Undo
  • when recovering from a system failure
  • incomplete transactions
  • Partial Redo
  • when recovering from a system failure
  • complete transactions
  • Global Redo
  • archive recovery
  • full redundancy

6
(No Transcript)
7
(No Transcript)
8
Different Views of a Database
  • Current database
  • the contents are found on disk or in the DB
    buffer
  • Materialized database
  • the state that the DBMS finds at restart after a
    crash
  • Physical database
  • all blocks of the on-line copy
  • Three types of update operations
  • modification of page contents affects the
    current database
  • write affects the physical database
  • propagation affects the materialized database

9
Mapping Concepts for Updates
Two schemes for propagation
  • Two types of propagation strategies
  • ATOMIC
  • NOT ATOMIC

10
Dependencies Between Buffer Management and
Recovery Component
  • UNDO Recovery Actions
  • STEAL undo actions necessary
  • NO STEAL undo actions not necessary
  • REDO Recovery Actions
  • FORCE redo actions not necessary
  • NO FORCE redo actions necessary
  • Partial REDO no logging necessary
  • Global REDO logging necessary

11
Classification of Log Data
  • Physical State Logging on Page Level
  • before image after image
  • Physical Transition Logging on Page Level
  • differences between old and new states
  • Physical State Logging on Access Path Level
  • Physical/Logical Transition Logging on the Access
    Path
  • Logical Logging on the Record-Oriented Level

12
Checkpoints
  • limit the amount of REDO recovery required after
    a crash
  • involve three steps
  • write a BEGIN_CHECKPOINT record
  • write all checkpoint data
  • write an END_CHECKPOINT record
  • types
  • Transaction-Oriented Checkpoints
  • Transaction-Consistent Checkpoints
  • Action-Consistent Checkpoints
  • Fuzzy Checkpoints

13
(No Transcript)
14
Conclusion
  • taxonomy for classifying the implementation
    techniques for
  • database recovery
  • four criteria
  • Propagation
  • ATOMIC/ NOT ATOMIC
  • Buffer Handling
  • STEAL / NO STEAL
  • EOT Processing
  • FORCE / NO FORCE
  • Checkpointing

15
(No Transcript)
16
ARIES A Transaction Recovery Method Supporting
Fine-Granularity Locking and Partial Rollbacks
Using Write-Ahead Logging
ARIES Algorithm for Recovery and Isolation
Exploiting Semantics
17
Goals
  • Simplicity
  • Operation logging
  • Flexible storage management
  • Partial rollbacks
  • Flexible buffer management
  • Recovery Independence
  • Logical undo
  • Parallelism and fast recovery
  • Minimal overhead

18
Normal Processing
  • Updates
  • Total or Partial Rollbacks
  • savepoints
  • Transaction Termination
  • Checkpoints
  • fuzzy checkpoints

Restart Processing
  • Analysis Pass
  • Redo Pass
  • Undo Pass

19
(No Transcript)
20
Log Records
  • LSN (Log Sequence Number)
  • unique id for each log record
  • Type
  • type of record
  • TransId
  • id of transaction that wrote the record
  • PrevLSN
  • LSN of the previous log record written by the
    same
  • transaction that wrote the record
  • PageID
  • id of the page referred by the log
  • UndoNextLSN
  • present in CLR
  • Data
  • redo/undo data describing the update

21
Page Structure
  • page_LSN the LSN of the log record describing
    the latest
  • update to the page

Transaction Table
  • TransId the id of the transaction
  • State
  • LastLSN
  • UndoNextLSN

Dirty Pages Table
  • PageId
  • RecLSN

22
Restart Processing
  • Analysis Pass
  • Redo Pass
  • Undo Pass
  • Selective or Deferred Restart

23
Media Recovery
  • fuzzy image copy (fuzzy archive dump)
  • image copy checkpoint
  • media recovery redo point

Nested Top Actions
  • top actions
  • nested top actions
Write a Comment
User Comments (0)
About PowerShow.com