Use this single operational view for the SQL text value for the current SQL step being run across VantageCloud Lake clusters. You can get additional details on that session to monitor the SQL text for the current step, provided that session is running a query.
Syntax
REPLACE FUNCTION SYSLIB.MonitorSQLTextSV ( HostIdIn SMALLINT, SessionNoIn INTEGER, RunVprocNo SMALLINT ) RETURNS TABLE ( HostId SMALLINT, SessionNo INTEGER, SeqNum SMALLINT, SQLTxt VARCHAR(31000) CHARACTER SET UNICODE, ParentSessionNo INTEGER, Type VARCHAR, Id VARCHAR, Name VARCHAR, Group VARCHAR ) ... ;
Syntax Elements
- HostIdIn
- Logical ID of a host (or client) with sessions logged on.
- SessionNoIn
- Session number of the SQL to monitor.
- RunVprocNo
- PE vproc number where the session runs.
- HostId
- This value is incremented by 10000 for each compute cluster. For example, the first node of the primary cluster starts at 1, the first node of the first online compute cluster starts at 10001, and the first node of the second online compute cluster starts with 20001, and so on.
- SessionNo
- Session number of the SQLtext.
- SeqNum
- Sequence number of the row. For example, if the SQL text exceeds 31,000 bytes, the system returns multiple rows.
- SQLTxt
- SQL text of the running request.
- ParentSessionNo
- Only available in the detailed view and for compute clusters. This integer links the query running from the primary cluster to the compute cluster. The Parent Session is the session from the primary cluster that correlates to this SessionNo from the compute cluster.
- Type
- Only available in the detailed view. Identifies the group type (compute cluster or primary cluster).
- Id
- Only available in the detailed view. Provides the TOS identifier the of the group (useful to identify compute clusters).
- Name
- Only available in the detailed view. Provides the name of the compute cluster.
- Group
- Only available in the detailed view. Provides the name of the compute group.
Usage Notes
If MONITOR SQL processing is not completed within the timeout interval, then an error is returned to the client application. When a MONITOR SQL request is timed out, the processing continues internally to its completion. If the client application submits a new MONITOR SQL request for the same timed out target session while the previous timed out one is still being processed, then an error is returned.
For information on MONITOR SQL, see MONITOR SQL.