Explain recovery process after system failure using checkpoint.
Ans: Checkpoint scheme or method is an extra component of the log based recovery system. This scheme is used to limit the volume of log information which has to be handled and processed in the event of a system failure including the loss of volatile data. The checkpoint operation is carried out periodically copies log information onto the stable storage.
At every checkpoint, subsequent information is kept.
a. A start-of-checkpoint record that provides the identification that it is a checkpoint.
b. Each and every log information from the buffers in the volatile storage is copied to the log on stable storage.
c. All database updates from the buffers in the volatile storage are propagated to physical database.
d. An end-of-checkpoint record is written and the address of the checkpoint record is saved on a file accessible to the recovery routine on start-up after a system crash.
While failure do occur, it is often possible to resume processing from the most current checkpoint. All transactions which were saved before the checkpoint time need not be referred for the recovery operation. All transactions which were started before the checkpoint time but were not committed at that time are placed in an undo list that is a list of transactions to be undone.
Now here is the recovery system scans the log in a backward direction from the time of the system crash. If it finds out that a transaction in the undo list has committed, that transaction is removed from the undo list and placed in the REDO list, which consists of all the transactions that have to be redone. So a system crash occurring during the checkpoint operation needs recovery to be done using the most current previous checkpoint.