ITPEC FE Subject A October 2024 Question 21
If a transaction processing program ends abnormally while updating the database, the database is recovered by a rollback process. In these circumstances, which of the following is the information that is used?
Explanation
Pre-update information of log files — rollback undoes an unfinished transaction, so it needs the values as they were before the update.
When a transaction ends abnormally partway through, some of its updates may already be in the database. Rollback writes the before-images (pre-update values) recorded in the log back over those data, returning the database to its state at the start of the transaction.
Answer (b)
Why not others:
- •(a) — post-update (after-image) log information is used for roll-forward (redo), which reapplies committed updates after a media failure; applying it here would reinstate the incomplete changes instead of removing them
- •(c) — restoring the latest backup is the first step of media-failure recovery; it would discard every update made since the backup, including other transactions' committed work
- •(d) — a snapshot is likewise a point-in-time copy of the whole database, not a record of what this one transaction changed
Key rule: Rollback = undo with before-images from the log; roll-forward = restore a backup, then redo with after-images.
Databases · AI-written, may contain errors
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.