sp_thresholdaction

Description

Executes automatically when the number of free pages on the log segment falls below the last-chance threshold, unless the threshold is associated with a different procedure. Sybase does not provide this procedure.

Syntax

When a threshold is crossed, Adaptive Server passes the following parameters to the threshold procedure by position:

sp_thresholdaction @dbname,
	@segment_name,
	@space_left,
	@status

Parameters

@dbname

is the name of a database where the threshold was reached.

@segment_name

is the name of the segment where the threshold was reached.

@space_left

is the threshold size, in logical pages.

@status

is 1 for the last-chance threshold; 0 for all other thresholds.

Examples

Example 1

Creates a threshold procedure for the last-chance threshold that dumps the transaction log to a tape device:

create procedure sp_thresholdaction 
        @dbname varchar(30),
        @segmentname varchar(30),
        @space_left int,
        @status int
as
        dump transaction @dbname to tapedump1

Usage


Waking suspended processes

See also

Commands create procedure, dump transaction

System procedures sp_addthreshold, sp_dboption, sp_dropthreshold, sp_helpsegment, sp_helpthreshold, sp_modifythreshold, sp_who