monSysSQLText

Description

Provides the most recently executed SQL text, or the SQL text currently executing. The maximum number of rows returned can be tuned with sql text pipe max messages.

NoteEnable the enable monitoring, SQL text pipe active, max SQL text monitored, and SQL text pipe max messeges configuration parameters for this monitoring table to collect data.

monSysSQLText is a historical monitoring table. See “Stateful historical monitoring tables”.

Columns

Name

Datatype

Attributes

Description

SPID

smallint

Session process identifier.

KPID

int

Kernel process identifier.

ServerUserID

int

Server user identifier (SUID) of the user who executed this SQL text. The ServerUserID matches the value in syslogins.suid. Use the suser_name function to obtain the corresponding name.

BatchID

int

Unique identifier for the SQL batch containing the SQL text.

SequenceInBatch

int

Indicates the position of this portion of SQL text within a batch (the SQL text for a batch may span multiple rows).

SQLText

varchar(255)

Null

SQL text.

NoteIn many cases the text for a query spans multiple rows in this table. Arrange rows in proper order by sorting on the SequenceInBatch column in ascending order.