Recovery algorithm

The internal database recovery process in a nonclustered Adaptive Server is similar to that of the Cluster Edition. The same phases are necessary for single and multiple instance failure recovery.

Table 10-1: Recovery steps for clustered and nonclustered servers

Nonclustered recovery phases

Cluster Edition recovery phases

1) Estimate recoverable log boundaries – the recoverable log is from the oldest active transaction recorded in the recovery checkpoint to the end of the log.

1) Estimate recoverable log boundaries (same as in nonclustered Adaptive Server).

2) Analysis – scans the recoverable log forward, from the oldest active transaction to the end of the log, builds recovery information as incomplete transactions and so on. This information is used in the redo, undo, and post-undo passes.

2) Analyze the log from the database being recovered (same as in nonclustered Adaptive Server).

3) Redo – scans the recoverable log forward, and re-executes operations specified by log records, as needed.

3) Redo – the locks for incomplete transactions are acquired.

4) Reserve compensation log record space to undo incomplete transactions on the failed instance.

5) Release all locks acquired by the failed instance prior to the failure, except for those acquired at step 3 for incomplete transactions.

4) Undo – works from the end of the log back to the beginning of the oldest incomplete transaction, and undoes operations specified by log records for incomplete transactions. For each transaction, Adaptive Server logs a compensation log record.

6) Undo – also, logical locks for incomplete transactions are released as completed.

7) Fill free space information (threshold manager recovery).

5) Post-undo – logs a checkpoint record on the database, fills free space count recovery information (threshold recovery), and clears caches.

8) Post-undo – flushes all dirty buffers on the recovery instance. The Cluster Edition does not perform a checkpoint after instance failover recovery.

NoteSee Chapter 11 “Developing a Backup and Recovery Plan,” in the System Administration Guide: Volume 2.