ScholarQuill logoScholarQuillUniversity Notes
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
Study Tools
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
Contact
ScholarQuill logo
My Semester
Explore Notes
Past Papers12 New
Video CoursesNew
Search
Settings
GPA/CGPA Calculator
Schedule & To-Do
Student Portal
Contact
ScholarQuill logoScholarQuillUniversity Notes
Study PortalCOMP3146Recovery Techniques
Ctrl + K
Login
Explore
Search
Semester
Papers
CGPA
    COMP3146

    Advance Database Management Systems

    Progress0 / 18 done
    Topics18
    1Introduction to advance data models such as object relational, object oriented2File organizations concepts3Transactional processing4Concurrency control techniques5Recovery techniques6Query processing and optimization7Database Programming (PL/SQL)8Database Programming (T-SQL)9Database Programming (similar technology)10Integrity and security11Database Administration (Role management)12Database Administration (managing database access)13Database Administration (views)14Physical database design and tuning15Distributed database systems16Emerging research trends in database systems17MONGO DB18NO SQL (or similar technologies)
    3 min read
    Topic 5 of 18
    Topic Study Note Illustration
    05

    Recovery techniques

    Recovery in DBMS refers to the process of restoring the database to a correct state after a failure such as:

    ๐Ÿ› ๏ธ Recovery Techniques in Database Systems


    ๐Ÿ”ฐ What is Recovery?

    Recovery in DBMS refers to the process of restoring the database to a correct state after a failure such as:

    • System crash
    • Transaction failure
    • Media failure (disk crash)
    • Power failure

    The aim is to ensure data integrity and durability by preserving the effects of committed transactions and undoing uncommitted ones.


    ๐Ÿ”‘ Important Concepts

    • Failure Types:

      • Transaction failure: Logical errors or violation of integrity constraints.
      • System crash: Power failure, OS crash.
      • Media failure: Hardware damage to storage.
    • Recovery Manager: A DBMS component responsible for recovery operations.


    โœ… Key Recovery Techniques

    1. Deferred Update (No-Force, Steal Policy)

    • Changes made by a transaction are kept in memory and written to disk only after the transaction commits.
    • No updates are written to disk before commit.
    • If failure occurs before commit, no undo is required because changes are not saved.

    Advantages:

    • Simple recovery (only redo needed).
    • Avoids unnecessary disk writes.

    Disadvantages:

    • Recovery time can be long because all updates since last checkpoint must be redone.

    2. Immediate Update (Force, No-Steal Policy)

    • Updates can be written to disk before transaction commits.
    • If a transaction fails, DBMS must undo its changes from the disk.

    Advantages:

    • Changes are on disk quickly, improving durability.

    Disadvantages:

    • Recovery requires both undo and redo operations.
    • Requires a robust logging mechanism.

    3. Write-Ahead Logging (WAL) Protocol

    A fundamental technique used by most DBMSs for recovery.

    • Before any data item is written to disk, its before-image and after-image must be recorded in the log.
    • The log is stored on stable storage.

    Types of Log Records:

    • Update record: Contains before and after values of a data item.
    • Commit record: Marks transaction commit.
    • Abort record: Marks transaction abort.

    Properties:

    • Guarantees atomicity and durability.
    • Supports undo and redo operations.

    4. Checkpointing

    • Periodic process of writing the current state of the database and log to stable storage.
    • Reduces recovery time by limiting how far back the system needs to scan the log.

    Types:

    • Fuzzy Checkpoint: Database continues processing transactions during checkpoint.
    • Consistent Checkpoint: All transactions paused during checkpoint.

    5. Undo and Redo Operations

    Operation Purpose
    Undo Revert changes of uncommitted transactions to maintain atomicity.
    Redo Reapply changes of committed transactions that might not have been written to disk.

    6. Shadow Paging

    • The database keeps two page tables: current and shadow.
    • All updates are made to the current page table.
    • When transaction commits, current page table replaces shadow page table.
    • On failure, shadow page table is used to restore the database.

    Advantages:

    • Simple recovery (just discard current page table on failure).

    Disadvantages:

    • Inefficient for high update workloads.
    • Requires large memory for page tables.

    ๐Ÿ“ Recovery Algorithm Example: ARIES (Algorithms for Recovery and Isolation Exploiting Semantics)

    ARIES is a widely used recovery method based on:

    • Write-Ahead Logging (WAL)
    • Repeating History during redo
    • Logging logical undo operations

    Phases:

    1. Analysis: Identify dirty pages and active transactions.
    2. Redo: Reapply all changes from the log.
    3. Undo: Rollback incomplete transactions.

    ๐Ÿ›ก๏ธ Summary Table of Recovery Techniques

    Technique Description Undo Required Redo Required Disk Writes Timing
    Deferred Update Updates written after commit No Yes After commit
    Immediate Update Updates can be written anytime Yes Yes Before or after commit
    Write-Ahead Logging Log before data write Yes Yes Before data write
    Checkpointing Periodic saving of DB state N/A N/A N/A
    Shadow Paging Keep shadow copies of data pages No No At commit

    ๐Ÿ’ก Why Recovery Techniques Matter?

    • Ensure database consistency and durability despite failures.
    • Provide support for transaction atomicity.
    • Minimize system downtime and data loss.
    • Crucial for mission-critical applications (banking, airline reservation).

    โ† Previous topic 4
    Concurrency control techniques
    Next topic 6 โ†’
    Query processing and optimization

    Past Papers

    Open this section to view and download past papers

    Click on Show Past Papers to load available exam papers.

    Reading Progress
    0%
    3mremaining
    593words
    Beginnerlevel
    On This Page

    No headings found

    Study Toolkit

    Subject Portal

    Advance Database Management Systems