ARIES Algorithm Form Database Recovery
ARIES Algorithm Form Database Recovery
In it, every log record is assigned a unique and monotonically increasing log
sequence number (LSN). Every data page has a page LSN field that is set to
the LSN of the log record corresponding to the last update on the page. WAL
requires that the log record corresponding to an update make it to stable
storage before the data page corresponding to that update is written to disk. For
performance reasons, each log write is not immediately forced to disk. A log
tail is maintained in main memory to buffer log writes. The log tail is flushed
to disk when it gets full. A transaction cannot be declared committed until the
commit log record makes it to disk.
Once in a while the recovery subsystem writes a checkpoint record to the
log. The checkpoint record contains the transaction table and the dirty page
table. A master log record is maintained separately, in stable storage, to
store the LSN of the latest checkpoint record that made it to disk. On
restart, the recovery subsystem reads the master log record to find the
checkpoint’s LSN, reads the checkpoint record, and starts recovery from
there on.
The recovery process actually consists of 3 phases:
1. Analysis:
The recovery subsystem determines the earliest log record from which the next
pass must start. It also scans the log forward from the checkpoint record to
construct a snapshot of what the system looked like at the instant of the crash .
2. Redo:
Starting at the earliest LSN, the log is read forward and each update redone.
3. Undo:
The log is scanned backward and updates corresponding to loser transactions
are undone.
**************************