Manages the last-chance threshold.
Returns the current value of the last-chance threshold.
Aborts transactions in a transaction log that has reached its last-chance threshold.
lct_admin({{"lastchance" | "logfull" | "reserved_for_rollbacks"}, database_id |"reserve", {log_pages | 0 } | "abort", process-id [, database-id]})
creates a last-chance threshold in the specified database.
returns 1 if the last-chance threshold has been crossed in the specified database and 0 if it has not.
determines the number of pages a database currently reserved for rollbacks.
specifies the database.
obtains either the current value of the last-chance threshold or the number of log pages required for dumping a transaction log of a specified size.
is the number of pages for which to determine a last-chance threshold.
returns the current value of the last-chance threshold. The size of the last-chance threshold in a database with separate log and data segments does not vary dynamically. It has a fixed value, based on the size of the transaction log. The last-chance threshold varies dynamically in a database with mixed log and data segments.
aborts transactions in a database where the transaction log has reached its last-chance threshold. Only transactions in LOG SUSPEND mode can be aborted.
describes the free space available for the log segment. This is the total value of free space, not per-disk.
The ID (spid) of a process in log-suspend mode. A process is placed in log-suspend mode when it has open transactions in a transaction log that has reached its last-chance threshold (LCT).
the ID of a database whose transaction log has reached its LCT. If process-id is 0, all open transactions in the specified database are terminated.
This creates the log segment last-chance threshold for the database with dbid 1. It returns the number of pages at which the new threshold resides. If there was a previous last-chance threshold, it is replaced:
select lct_admin("lastchance", 1)
Returns 1 if the last-chance threshold for the database with db_id of 6 has been crossed, and 0 if it has not:
select lct_admin("logfull", 6)
Calculates and returns the number of log pages that would be required to successfully dump the transaction log in a log containing 64 pages:
select lct_admin("reserve", 64)
----------- 16
Returns the current last-chance threshold of the transaction log in the database from which the command was issued:
select lct_admin("reserve", 0)
Aborts transactions belonging to process 83. The process must be in log-suspend mode. Only transactions in a transaction log that has reached its LCT are terminated:
select lct_admin("abort", 83)
Aborts all open transactions in the database with database ID 5. This form awakens any processes that may be suspended at the log segment last-chance threshold:
select lct_admin("abort", 0, 5)
Determines the number of pages reserved for rollbacks in the pubs2 database, which has a pubid of 5:
select lct_admin("reserved_for_rollbacks", 5, 0)
Describes the free space available for a database with database ID of 4:
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 “String functions”.
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, Adaptive 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.
To terminate 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.
For more information, see the System Administration Guide.
SQL92 – Compliance level: Transact-SQL extension.
Only a System Administrator can execute lct_admin abort. Any user can execute the other lct_admin options.
Command dump transaction
Function curunreservedpgs
System procedures sp_thresholdaction