Monitoring Free Space with the Last-Chance Threshold

All databases, including master, have a last-chance threshold, which is an estimate of the number of free log pages that are required to back up the transaction log. As you allocate more space to the log segment, SAP ASE automatically adjusts the last-chance threshold.

When the amount of free space in the log segment falls below the last-chance threshold, SAP ASE automatically executes a special stored procedure called sp_thresholdaction. (Use sp_modifythreshold to specify a different last-chance threshold procedure. See the Reference Manual: Procedures).

This figure illustrates a log segment with a last-chance threshold. The shaded area represents used log space; the unshaded area represents free log space. The last-chance threshold has not yet been crossed.

Log Segment with a Last-Chance Threshold
Graphic showing the layout of the log segment and the placement of the last-chance threshold in the middle of the free space.

As users execute transactions, the amount of free log space decreases. When the amount of free space crosses the last-chance threshold, SAP ASE executes sp_thresholdaction.

Executing sp_thresholdaction when the Last-Chance Threshold Is Reached
Graphic showing the layout of the log segment and the placement of the last-chance threshold at the beginning of the free space.