DB2 Version 9.7 for Linux, UNIX, and Windows

WLM_GET_SERVICE_CLASS_WORKLOAD_OCCURRENCES_V97 table function - list workload occurrences

The WLM_GET_SERVICE_CLASS_WORKLOAD_OCCURRENCES_V97 function returns the list of all workload occurrences running in a specified service class on a particular partition. A workload occurrence is a specific database connection whose attributes match the definition of a workload and hence is associated with or assigned to the workload.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-WLM_GET_SERVICE_CLASS_WORKLOAD_OCCURRENCES_V97--(--service_superclass_name--,-->

>--service_subclass_name--,--dbpartitionnum--)-----------------><

The schema is SYSPROC.

Table function parameters

service_superclass_name
An input argument of type VARCHAR(128) that specifies the name of a service superclass in the currently connected database. If the argument is null or an empty string, the data is retrieved for all the superclasses in the database that match the values of the other parameters.
service_subclass_name
Target service subclass for the workload occurrence. Any work submitted by this workload occurrence will run in this service subclass under the target service superclass with the exception of activities that are mapped, or remapped, to a different subclass.
dbpartitionnum
An input argument of type INTEGER that specifies the number of a partition in the same instance as the currently connected database. Specify -1 for the current database partition, or -2 for all database partitions. If the null value is specified, -1 is set implicitly.

Authorization

EXECUTE privilege on the WLM_GET_SERVICE_CLASS_WORKLOAD_OCCURRENCES_V97 function.

Example

If an administrator wants to see what workload occurrences are running on the system as a whole, the administrator can call the WLM_GET_SERVICE_CLASS_WORKLOAD_OCCURRENCES_V97 function by specifying a null value or an empty string for service_superclass_name and service_subclass_name and -2 for dbpartitionnum:

  SELECT SUBSTR(SERVICE_SUPERCLASS_NAME,1,19) AS SUPERCLASS_NAME,
         SUBSTR(SERVICE_SUBCLASS_NAME,1,18) AS SUBCLASS_NAME,
         SUBSTR(CHAR(DBPARTITIONNUM),1,4) AS PART,
         SUBSTR(CHAR(COORD_PARTITION_NUM),1,4) AS COORDPART,
         SUBSTR(CHAR(APPLICATION_HANDLE),1,7) AS APPHNDL,
         SUBSTR(WORKLOAD_NAME,1,22) AS WORKLOAD_NAME,
         SUBSTR(CHAR(WORKLOAD_OCCURRENCE_ID),1,6) AS WLO_ID
  FROM TABLE(WLM_GET_SERVICE_CLASS_WORKLOAD_OCCURRENCES_V97
        (CAST(NULL AS VARCHAR(128)), CAST(NULL AS VARCHAR(128)), -2))
         AS SCINFO
  ORDER BY SUPERCLASS_NAME, SUBCLASS_NAME, PART, APPHNDL,
         WORKLOAD_NAME, WLO_ID

If the system has four database partitions and is currently running two workloads, the previous query produces results such as the following ones:

SUPERCLASS_NAME     SUBCLASS_NAME      PART COORDPART ...
------------------- ------------------ ---- --------- ...
SYSDEFAULTMAINTENAN SYSDEFAULTSUBCLASS 0    0         ...
SYSDEFAULTSYSTEMCLA SYSDEFAULTSUBCLASS 0    0         ...
SYSDEFAULTUSERCLASS SYSDEFAULTSUBCLASS 0    0         ...
SYSDEFAULTUSERCLASS SYSDEFAULTSUBCLASS 0    0         ...
SYSDEFAULTUSERCLASS SYSDEFAULTSUBCLASS 1    0         ...
SYSDEFAULTUSERCLASS SYSDEFAULTSUBCLASS 1    0         ...
SYSDEFAULTUSERCLASS SYSDEFAULTSUBCLASS 2    0         ...
SYSDEFAULTUSERCLASS SYSDEFAULTSUBCLASS 2    0         ...
SYSDEFAULTUSERCLASS SYSDEFAULTSUBCLASS 3    0         ...
SYSDEFAULTUSERCLASS SYSDEFAULTSUBCLASS 3    0         ...
... APPHNDL WORKLOAD_NAME          WLO_ID
... ------- ---------------------- ------
... -       -                      -
... -       -                      -
... 1       SYSDEFAULTUSERWORKLOAD 1
... 2       SYSDEFAULTUSERWORKLOAD 2
... 1       SYSDEFAULTUSERWORKLOAD 1
... 2       SYSDEFAULTUSERWORKLOAD 2
... 1       SYSDEFAULTUSERWORKLOAD 1
... 2       SYSDEFAULTUSERWORKLOAD 2
... 1       SYSDEFAULTUSERWORKLOAD 1
... 2       SYSDEFAULTUSERWORKLOAD 2

Usage note

The parameters are, in effect, ANDed together. That is, if you specify conflicting input parameters, such as a service superclass SUP_A and a subclass SUB_B such that SUB_B is not a subclass of SUP_A, no rows are returned.

Note: Statistics reported for the workload occurrence (for example, coord_act_completed_total) are reset at the beginning of each unit of work when they are combined with the corresponding workload statistics.

Information returned

Table 1. Information returned for WLM_GET_SERVICE_CLASS_WORKLOAD_OCCURRENCES_V97
Column name Data type Description
SERVICE_SUPERCLASS_NAME VARCHAR(128) service_superclass_name - Service superclass name monitor element
SERVICE_SUBCLASS_NAME VARCHAR(128) service_subclass_name - Service subclass name monitor element
DBPARTITIONNUM SMALLINT Partition number from which this record was collected.
COORD_PARTITION_NUM SMALLINT coord_partition_num - Coordinator partition number monitor element
APPLICATION_HANDLE BIGINT application_handle - Application handle monitor element
WORKLOAD_NAME VARCHAR(128) workload_name - Workload name monitor element
WORKLOAD_OCCURRENCE_ID INTEGER workload_occurrence_id - Workload occurrence identifier monitor element
WORKLOAD_OCCURRENCE_STATE VARCHAR(32) workload_occurrence_state - Workload occurrence state monitor element
UOW_ID INTEGER uow_id - Unit of work ID monitor element
SYSTEM_AUTH_ID VARCHAR(128) system_auth_id - System authorization identifier monitor element
SESSION_AUTH_ID VARCHAR(128) session_auth_id - Session authorization ID monitor element
APPLICATION_NAME VARCHAR(128) appl_name - Application name monitor element
CLIENT_WRKSTNNAME VARCHAR(255) client_wrkstnname - Client workstation name monitor element
CLIENT_ACCTNG VARCHAR(255) client_acctng - Client accounting string monitor element
CLIENT_USER VARCHAR(255) Current value of the CLIENT_USERID special register for this workload occurrence.
CLIENT_APPLNAME VARCHAR(255) client_applname - Client application name monitor element
COORD_ACT_COMPLETED_TOTAL INTEGER coord_act_completed_total - Coordinator activities completed total monitor element
COORD_ACT_ABORTED_TOTAL INTEGER coord_act_aborted_total - Coordinator activities aborted total monitor element
COORD_ACT_REJECTED_TOTAL INTEGER coord_act_rejected_total - Coordinator activities rejected total monitor element
CONCURRENT_ACT_TOP INTEGER concurrent_act_top - Concurrent activity top monitor element
ADDRESS VARCHAR(255) address - IP address from which the connection was initiated