Backup and Recovery Flashcards
What are the 3 storage structures that a database uses?
Primary : Volatile data where data is operated on.
Secondary : Non-volatile data storage such as that on disk.
Stable : Backup data stored from the primary storage.
What is a checkpoint? What operations does a checkpoint conduct upon creation?
A point of synchronisation between database and log file. Operations: Write log file to secondary storage;
Write a checkpoint record to the log file containing currently active transactions; UNDO; REDO.
What happens when a failure occurs?
The system checks the log file in reverse back to the last checkpoint. System can then REDO all transactions that
committed since last checkpoint, or UNDO all transactions that were active at the time of crash.
What is a backup? And what are backup points?
A backup is an accessible previous state of the database. Backup points are accessible backups throughout the lifecycle of the database.
What are the 3 types of backups? Define each…
Full backup : Backsup entire database.
Differential backup : Backs up changes since last full backup.
Incremental backup : Backs up changes since last incremental backup.
Define recovery…
Recovery is the restoration of the database to a correct state.
Explain how the log based recovery protocol works…
Log based recovery keeps a log of all transactions, and implements checkpoints into the log file at pre-determined
intervals. Each checkpoint maps to a previous database state that the current database can be restored to.
What are the 2 operations that can be performed while using a log based recovery protocol? Explain them…
REDO : System can REDO all committed transactions since last checkppoint (after system failure)
UNDO : System can UNDO all active transactions at (time of crash) in the reverse order of the log file.
What is meant by a deferred update? What operations does it have?
Deferred Update : Logs of uncommitted transactions are made and pushed to the log file.
Once a commit is made the logged transactions complete. This only has a REDO operation, which is used to complete the uncommitted transactions.
What is meant by immediate update? What operations does it have?
Immediate Update : Transactions immediately update the database, and don’t have to wait for a commit. Has REDO and UNDO operations in case of system failure.
Explain how the UNDO and REDO operations work for immediate update…
If a system has an immediate update recovery scheme and crashes, the REDO operation can recomplete all transactions since last update in the correct order. The UNDO operation can undo active transactions in reverse log file order.
Explain shadow paging…
Shadow paging is an alternative backup and recovery method, in which 2 tables are concurrently maintained. The current database and the shadow database. During each transaction, the current page table is copied and stored in the shadow page table, providing a backup in case an error occurs.
What are the pros and cons of shadow paging?
Pros : No log file maintenance; Faster recovery due to no UNDO / REDO operations.
Cons : Data fragmentation (scattered); Needs garbage collection to collect inaccessible data.