DATABAS

    Master this deck with 22 terms through effective study methods.

    Generated from uploaded pptx

    Created by @tanveer

    What is the purpose of database recovery?

    The purpose of database recovery is to restore the database to a correct and consistent state after a failure, ensuring that no data is lost and that the database remains in a valid state.

    What are the main types of failures in a DBMS?

    The main types of failures in a DBMS include transaction failures, system crashes, and data transfer failures, each of which can disrupt the normal operation of the database.

    How does Immediate Update recovery work?

    Immediate Update recovery allows the database to be updated before a transaction commits. In case of failure, uncommitted changes are undone, while committed changes are redone to maintain consistency.

    What is Deferred Update recovery and how does it differ from Immediate Update?

    Deferred Update recovery applies updates only after a transaction commits. Unlike Immediate Update, if a failure occurs, there is no need to undo changes, only to redo committed transactions.

    Explain the concept of Shadow Paging.

    Shadow Paging is a recovery technique that maintains two versions of database pages: a current page table for modified pages and a shadow page table for original pages. If a transaction fails, the system reverts to the shadow page without needing to undo changes.

    What role does Checkpointing play in database recovery?

    Checkpointing is an optimization that periodically saves the state of the database and log records to stable storage, allowing for faster recovery by reducing the amount of log data that needs to be processed after a crash.

    What is a transaction failure and what can cause it?

    A transaction failure occurs when one or more statements within a transaction cannot execute successfully, often due to logical errors, resource unavailability, or constraints violations.

    What are the potential causes of a system crash in a DBMS?

    System crashes can be caused by power supply disruptions, software issues such as operating system failures, or hardware malfunctions, all of which can lead to the failure of currently running transactions.

    How can hard-disk failures impact database transactions?

    Hard-disk failures can prevent transactions from reading or writing data, leading to transaction failures and potential data loss, as the database cannot access the necessary storage resources.

    What are the ACID properties and why are they important for recovery?

    The ACID properties—Atomicity, Consistency, Isolation, and Durability—are crucial for ensuring that transactions are processed reliably and that the database remains in a valid state, especially during recovery from failures.

    What is the significance of atomicity in transaction processing?

    Atomicity ensures that a transaction is treated as a single unit of work, meaning it either completes fully or not at all, which is essential for maintaining data integrity during recovery.

    How does durability affect database recovery?

    Durability guarantees that once a transaction has been committed, its effects are permanent, even in the event of a system failure, which is vital for reliable database recovery.

    What is the difference between undo and redo operations in recovery?

    Undo operations revert uncommitted changes made by a transaction, while redo operations reapply changes from committed transactions to ensure that the database reflects the correct state after recovery.

    When is a checkpoint record written into the log file?

    A checkpoint record is written into the log file during a checkpoint operation, which occurs periodically to mark a point in the log where all previous log records and modified pages have been saved to stable storage.

    What happens to the shadow page table during a transaction?

    During a transaction, the shadow page table remains unchanged and continues to point to the original database pages, while the current page table is updated to point to new copies of modified pages.

    Why is it important to have a recovery mechanism in a DBMS?

    A recovery mechanism is essential in a DBMS to ensure data integrity, prevent data loss, and maintain consistent database states in the face of various types of failures.

    What is the impact of a logical error on a transaction?

    A logical error in a transaction can cause it to fail, as the incorrect logic may lead to invalid operations or constraints violations, preventing successful execution.

    How does a system ensure that committed transactions are not lost during recovery?

    A system ensures that committed transactions are not lost during recovery by using logging mechanisms that record all changes made by transactions, allowing for redo operations to reapply these changes if necessary.

    What is the relationship between recovery techniques and the ACID properties?

    Recovery techniques are designed to uphold the ACID properties, ensuring that transactions are processed reliably, maintaining atomicity, consistency, isolation, and durability even in the event of failures.

    How does the concept of a 'bookmark' relate to checkpointing?

    In the context of checkpointing, a 'bookmark' refers to a specific point in the log file that indicates all changes up to that point have been saved, allowing for quicker recovery by not having to process the entire log.

    What is the role of stable storage in database recovery?

    Stable storage is crucial in database recovery as it provides a reliable medium for storing log records and modified pages, ensuring that data can be restored accurately after a failure.

    What happens to the current page table if a transaction commits?

    If a transaction commits, the current page table becomes the new shadow page table, effectively making the changes permanent and allowing the system to revert to this state in case of future failures.