15 Recovery Techniques Flashcards
(23 cards)
What is the purpose of recovery techniques in databases?
To restore the database to a correct state after system crashes or transaction errors.
What does the system log record?
All actions performed by transactions, used for undo/redo during recovery.
What is a checkpoint in database recovery?
A saved consistent state of the database to speed up recovery after a crash.
What is a commit point?
When a transaction is successfully completed and all its changes become permanent.
What happens if a system crashes after a commit point?
The committed transaction is redone, not undone.
What is a catastrophic failure?
A severe failure where the DB must be restored from an external backup.
What is a non-catastrophic failure?
A crash that makes the DB inconsistent but can be fixed using undo/redo actions.
What are immediate updates?
Changes are applied to the database right away, before the transaction commits.
What are deferred updates?
Changes are delayed until the transaction commits, ensuring consistency.
Why don’t deferred updates need undo actions?
Because no changes are applied unless the transaction commits.
What is buffering?
Making updates in main memory before writing to disk.
What is caching in database recovery?
Loading disk pages into memory before updating.
What is cascading rollback?
When one transaction’s failure causes others to fail because they depended on its changes.
What does [start-transaction, T] mean in a system log?
Marks the beginning of transaction T.
What does [write-item, T, X, oldvalue, newvalue] mean in a system log?
T updated item X from oldvalue to newvalue.
What does [commit, T] mean in a system log?
Transaction T finished successfully; changes are permanent.
What does [abort, T] mean in a system log?
Transaction T failed and was rolled back.
What is the rule for handling transactions during recovery?
Undo uncommitted transactions; redo committed ones.
When is a transaction considered committed?
When [commit, T] is written in the log.
What is the problem with storing logs in main memory?
They are lost in a crash unless written to disk.
How do we prevent loss of log data in memory?
Force writing logs to disk before applying changes.
What does a [checkpoint] entry in the log do?
Marks a point from which recovery can start, skipping earlier transactions.
What are the steps to take a checkpoint?
Pause transactions, write changes to disk, log the checkpoint, resume transactions.