lct_admin

Manages the last-chance threshold (LCT). It returns the current value of the LCT and aborts transactions in a transaction log that has reached its LCT.

Syntax

lct_admin({{"lastchance" | "logfull" | "reserved_for_rollbacks"},
	database_id
	|"reserve", {log_pages | 0 }
	| "abort", process-id [, database-id]})

Parameters

Examples

Usage

  • lct_admin, a system function, manages the log segment’s last-chance threshold. For general information about system functions, see Transact-SQL Users Guide.

  • If lct_admin(“lastchance”, dbid) returns zero, the log is not on a separate segment in this database, so no last-chance threshold exists.

  • Whenever you create a database with a separate log segment, the server creates a default last chance threshold that defaults to calling sp_thresholdaction. This happens even if a procedure called sp_thresholdaction does not exist on the server at all.

    If your log crosses the last-chance threshold, the SAP ASE server suspends activity, tries to call sp_thresholdaction, finds it does not exist, generates an error, then leaves processes suspended until the log can be truncated.

  • To terminate:
    • The oldest open transaction in a transaction log that has reached its LCT, enter the ID of the process that initiated the transaction.

    • All open transactions in a transaction log that has reached its LCT, enter 0 as the process-id, and specify a database ID in the database-id parameter.

See also:
  • dump transaction in Reference Manual: Commands

  • sp_thresholdaction in Reference Manual: Procedures

  • System Administration Guide; Transact-SQL Users Guide

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

The permission checks for lct_admin differ based on your granular permissions settings.

Granular PermissionsDescription
Enabled

With granular permissions enabled, you must have manage database permission to execute lct_admin abort. Any user can execute the other lct_admin options.

Disabled

With granular permissions disabled, you must be a user with sa_role to execute lct_admin abort. Any user can execute the other lct_admin options.

Related reference
curunreservedpgs