15.10 - TDWM WD ASSIGNMENT - Teradata Database

Teradata Database Application Programming Reference

prodname
Teradata Database
vrm_release
15.10
category
Programming Reference
featnum
B035-1090-151K

Changes the Workload a session or request is assigned to.

 

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.

Note: 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” on page 162.

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 Teradata 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
  • For examples of the scope field, see “Usage Notes” on page 382.

    WLC_id

    INTEGER

    WD ID to which the request should be assigned.

    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:

  • Database Administration
  • Security Administration
  • Teradata JDBC Driver User Guide
  • 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.

    Note: 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.

     

     

    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

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

    Note: 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

    For an example of how the PM/API request, built in Java, appears when sent to the Teradata Database server, see Teradata JDBC Driver Reference.

    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.