TDWM WD Assignment Request | Application Programming Reference | Vantage - TDWM WD ASSIGNMENT - Advanced SQL Engine - Teradata Database

Application Programming Reference

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
cpn1571792172880.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1090
lifecycle
previous
Product Category
Teradata Vantage™

Purpose

Changes the Workload a session or request is assigned to.

Input Data

Element Data Type Description
IndByte BYTE Indicator bits that specify which fields to treat as NULL if you are using indicator mode.

Each bit in the byte corresponds to one field in the input data.

If data is supplied for that field, set the bit to zero.

If the data for that field is NULL (that is, there is no data supplied for that field), set the bit to 1.

The IndByte field is only required if the CLIv2 request is submitted in indicator mode.
mon_ver_id SMALLIN

NOT NULL

MONITOR software version ID. This can be version 6 or later.

For a general explanation of monitor version choices, see MONITOR VERSION.

host_id SMALLINT Host upon which the session was established. The host ID cannot exceed 1023. A host ID of zero identifies the database operator console.
session_no INTEGER Session number for his record. This value is assigned by the host (or client) at logon.

Together with a given Host ID, a session number uniquely identifies a session on the database system.

PE_vproc_no SMALLINT PE vproc number where the session runs.
scope SMALLINT Scope of the change defined:
  • 0 = Current request
  • 1 = Session
WLC_id INTEGER WD ID to which the request should be assigned.

Monitor Privileges

To use this request, you must have the ABORTSESSION and MONSESSION privileges as part of your default role or both privileges must be granted directly to you.

For more information on roles and privileges, see:

Usage Notes

The TDWM WD ASSIGNMENT request is comparable to changing the session priority by the way of the SQL SET SESSION ACCOUNT statement when TASM Workloads are not enabled.

Use TDWM WD ASSIGNMENT to change the assigned WD for an individual request or session in cases where the rules imposed by the current WD prevent it from running as needed.

Use the MONITOR SESSION request to determine host_id, session_no, PE_vproc_no, scope, and WLC_id for the TDWM WD ASSIGNMENT input.

You must enable TASM Workloads in the Teradata Viewpoint Workload Designer portlet to use this request.

The following table shows how the scope determines the effects of the TDWM WD ASSIGNMENT.

If the scope = ... And there is ...
0 (current request) no active request, this request has no effect.
0 (current request) an active request, the current active request is moved into the specified WD. The “change workload” exception if specified is ignored for this request.
1 (session) request no active request, all subsequent requests on this session are assigned into the specified WD. If specified, the “change workload” exception is ignored for all requests.
1 (session) an active request, the current active request, and all subsequent requests on the session, move into the specified WD.

If specified, the “change workload” exception is ignored for all requests.

CLIv2 Request Parcels

Parcel Sequence Parcel Flavor Length (Bytes) Comments/Key Parcel Body Fields
Success 8 18 to 273 StatementNo = 1

ActivityCount = 0

ActivityType = 159 (PCLTWMWDASSIGNMENTSTMT)

EndStatement 11 6 StatementNo = 1
EndRequest 12 4 None

Sample Input - CLIv2 Request

The following example shows how the parcels for a TDWM WD ASSIGNMENT request, built by CLIv2, appear when sent to the database server.

In this example, the size of the response buffer in the example is set at the maximum (64,000 bytes), although you can set it to any size.
Flavor Length Body
Num Name Bytes Field Value
0001 Req 16 Request TDWM WD ASSIGNMENT
0003 Data 8 MonVerID

host_id

session_no

PE_vproc_no

scope

WLC_id

7

1

1000

16383

1

3

0004 Resp 6 BufferSize 64000

Sample Input - Teradata JDBC Driver Request

For an example of how the PM/API request, built in Java, appears when sent to the database server, see Teradata JDBC Driver Reference, available at https://teradata-docs.s3.amazonaws.com/doc/connectivity/jdbc/reference/current/frameset.html .

Sample Output

The TDWM WD ASSIGNMENT request returns values approximately as shown below when TASM Workloads rule is enabled and the following input data is specified:
  • host_id = 1
  • session_no = 1000
  • PE_vproc_no =16383
  • scope = 1
  • WLC_id = 3

The TDWM WD ASSIGNMENT request commonly returns values in text character format. Your application program may return the values in a different format or display.

Success parcel:
 StatementNo: 1    ActivityCount: 1
 ActivityType: 159    FieldCount: 1
DataInfo parcel:
 FieldCount: 1
EndStatement.
EndRequest.