Part 2 of 5 · 1 min read
The analysis phase
A first pass over the log, starting from the last checkpoint, determines which transactions need undoing and which pages might need redoing.
Think of a building inspector arriving after an unexpected evacuation. The inspector first walks the whole site just to make a list of which rooms were left mid-renovation and which were already finished, before touching anything at all.
In plain words: the analysis phase scans the log, starting from the most recent checkpoint covered on the previous page, to determine two things: which transactions were still active, not yet committed, at the moment of the crash, and which data pages might have been dirty, not yet flushed, at that moment. This phase makes no changes to any data at all; it purely gathers the information the next two phases need, producing a list of transactions requiring undo and a starting point for redo.
A worked example. Scanning the log from the last checkpoint onward, analysis finds that transaction A had committed and transaction B was still active at the crash, building the exact lists redo and undo will need next.
The key lines. No new SQL; analysis is the first automatic step ARIES performs internally when the database restarts after a crash.
Analysis phase
The analysis phase scans the log from the most recent checkpoint, without changing any data, to determine which transactions need undoing and which pages might need redoing.
Example: an inspector first walking a site just to list which rooms were mid-renovation versus already finished, before touching anything, mirrors the analysis phase.