System Recovery Procedure
Problems with Deferred & Immediate Updates
- Searching the entire log is time-consuming.
- It is possible to redo transactions that have already been stored their updates to the database.
- A point of synchronization between database and transaction log file.
- Specifies that any operations executed before this point done correctly and stored safely.
- Also, At this point, all the buffers force-fully are written to the secondary storage.
- Checkpoints scheduled at predetermined time intervals
- Used to limit –
- The size of transaction log file
- Amount of searching, and
- Subsequent processing that required to carry out on the transaction log file. When failure occurs
- Find out the nearest checkpoint.
- If a transaction has already committed before this checkpoint, ignore it.
- Moreover, If the transaction is active at this point or at this point and has committed before failure, redo that transaction.
- If a transaction is active at this point or at this point and has not committed, undo that transaction.
Example for System Recovery Procedure
- Consider the transactions given the in the following figure. Here, Tc indicates checkpoint, while Tf indicates failure time.
- Here, at failure time –
- Ignore the transaction T1 as it has already committed before the checkpoint.
- Redo transaction T2 and T3 as they are active at/after the checkpoint, but have committed before failure.
- Undo transaction T4 as it is active after the checkpoint and has not committed.