The most advance & most difficult recovery algorithm in ARIES recovery algorithm. The advantage of this recovery technique is that it reduces recovery time as well as overhead of a log.
1) Log Sequence No: - Refers to a pointer used to identify log records.
2) Dirty Page Table: - pages with their updated version placed in main memory & disk version of it is not updated.
3) Fuzzy checkpoint: - Means instead of using checkpoints, this algorithm uses fuzzy checkpoints maximize currency in transaction.
- In ARIES, a log consists of multiple log files. Each file has a specific capacity. If the 1st log file grows to some limit, then further log records are appended to a new log file. Each log file maintains a file n, which monotonically increases
- Each of this log file has been associated with an LSN, which is the combination of file no. & the offset of that particular file.
- Earn file contains a particular data page & the latest event related to that data page. Thus the corresponding LSN of a log file indicates particular operation of the stored data page during recovery procedure. It includes 3 phases:-
ANALYSIS PHASE :-
- The dirty page table has been formed by analysing the pages from the buffer and also a set of active transactions has been identified. When the system encounters crash, ARIES recovery manager starts the analysis phone by finding the last checkpoint log record after that, it prepares dirty pages tables this phone mainly prepares a set of active transactions that are needed to be undo analysis phone, after getting the last checkpoint log record, log record is scanned in forward direction, & update of the set of active transactions, transaction value, & dirty page table are done in the following manner :-
- 1st recovery manager finds, any transaction which is not in the active transaction set, then add that transaction in that set if it finds an end log record, then that record has been deleted from the transaction table.
- If it finds a log record that describes an update operation, the log record has been added to the dirty page table.
REDO PHASE:-
- Redo phase is the second phase where all the transactions that are needed to be executed again take place.
- It executes those operations whose results are not reflected in the disk.
- It can be done by finding the smallest LSN of all the dirty page in dirty page table that defines the log positions, & the Redo operation will start from this position
- This position indicates that either the changes that are made earlier are I the main memory or they have already been flaunted to the disk.
- Thus, for each change recorded in the log, the Redo phase determines whether or not the operations have been re-executed.
UNDO PHASE:-
- In the Undo phase, all the transaction, that is listed in the active transaction set here to be undone.
- Thus the log should be scanned background from the end & the recovery manages should Undo the necessary operations.
- Each time an operations is undone, a compensation log recorded has been written to the log.
- This process continues until there is no transaction left in the active transaction set.
- After the successful competition of this phase, database can resume its normal operations.