DB2 Version 9.7 for Linux, UNIX, and Windows

WLM_GET_SERVICE_CLASS_WORKLOAD_OCCURRENCES table function - List of workload occurrences

Returns the list of all workload occurrences executing in a given service class on a particular partition.

Note: This table function has been deprecated and replaced by the WLM_GET_SERVICE_CLASS_WORKLOAD_OCCURRENCES_V97 table function - list workload occurrences.

A workload occurrence is a specific database connection whose attributes match with 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--(--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 a valid service superclass name 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 for which the other parameters match.
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 a valid partition number in the same instance as the currently connected database. Indicate -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 function.

Example

If an administrator would like to see what workload occurrences are running on the system as a whole, the WLM_GET_SERVICE_CLASS_WORKLOAD_OCCURRENCES function can be called with 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
        (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

Assuming that the system has four database partitions and is running two workloads at this time, the preceding query would produce a result like the following output:

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         ...
Output from this query (continued).
... 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 have the effect of being ANDed together. That is, if one were to specify conflicting input parameters such as a service superclass SUP_A and subclass SUB_B such that SUB_B is not a subclass of SUP_A, no rows would be 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
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) The 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