Master this deck with 22 terms through effective study methods.
Generated from uploaded pptx
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.