monProcessSQLText

Description

Provides the SQL text currently being executed by the process. Use max SQL text monitored to tune the maximum size of the SQL text.

monProcessSQLText returns a row for each row of the SQL text batch a process executes (specified by SPID). That is, if a batch contains three rows, monProcessSQLText returns three rows in its result set. The value for LineNumber indicates the number of the line in the batch. If the length of a single row exceeds 255 bytes, monProcessSQLText returns multiple rows and the value for LineNumber is the same for all rows, but the value for SequenceInLine is different for each row.

Enable the enable monitoring, max SQL text monitored, SQL batch capture configuration parameter for this monitoring table to collect data.

Columns

The columns for monProcessSQLText are:

Name

Datatype

Attributes

Description

SPID

smallint

Session process identifier.

InstanceID

int

(Cluster environments only) ID of an instance in a shared-disk cluster.

KPID

int

Kernel process identifier.

ServerUserID

int

Server user identifier (SUID) of the user executing this SQL. The ServerUserID matches the value for the syslogins.suid column. Use the suser_name function to obtain the corresponding name.

BatchID

int

Unique identifier for the SQL batch containing the SQL text.

LineNumber

int

SQL batch line number for the row’s SQL text.

SequenceInLine

int

Each row has a unique, and increasing, SequenceInLine value. If the length of the SQL text exceeds 255 bytes, the text is split over multiple rows.

SQLText

varchar(255)

Null

The text being executed.