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.
lct_admin({{"lastchance" | "logfull" | "reserved_for_rollbacks"}, database_id |"reserve", {log_pages | 0 } | "abort", process-id [, database-id]})
select lct_admin("lastchance", 1)
select lct_admin("logfull", 6)
select lct_admin("reserve", 64)
----------- 16
select lct_admin("reserve", 0)
select lct_admin("abort", 83)
select lct_admin("abort", 0, 5)
select lct_admin("reserved_for_rollbacks", 5, 0)
select lct_admin("logsegment_freepages", 4)
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.
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.
dump transaction in Reference Manual: Commands
sp_thresholdaction in Reference Manual: Procedures
System Administration Guide; Transact-SQL Users Guide
ANSI SQL – Compliance level: Transact-SQL extension.
The permission checks for lct_admin differ based on your granular permissions settings.
Granular Permissions | Description |
---|---|
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. |