I am trying to ensure that the work in my WLM configuration is going to the right place but my workload is always pointing to the same service class even though I know that I have a work action set to point the incoming statement to a different class. What am I missing?
The first thing to burn into your memory :) is that a workload will always point to the service class used in its definition and all work submitted by that workload will be first routed to that service class for evaluation. It is the individual activities themselves which can be mapped into different service classes by a work action set or the REMAP action of certain activity thresholds; the workload itself never changes.
Also remember that an application can submit multiple concurrent statements in the same unit of work such as opening a cursor and then issuing an UPDATE statement based on that cursor which means that an individual occurrence of a workload can also have multiple concurrent actviities so we have to start thinking of looking at the individual activities not the workload when we want to know where things are executing.
In order to see where each of the statements is (currently) executing, you have to use the MON_GET_ACTIVITY (also known as WLM_GET_WORKOAD_OCCURRENCE_ACTIVITIES) table function in a query like this:
SELECT SUBSTR(V.SESSION_AUTH_ID,1,18) AS SESSION_AUTHID,
SUBSTR(V.APPLICATION_NAME,1,18) AS APPLNAME,
SUBSTR(U.PARENTSERVICECLASSNAME,1,24) AS SERVICE_SUPERCLASS_NAME,
SUBSTR(U.SERVICECLASSNAME,1,24) AS SERVICE_SUBCLASS_NAME,
SUBSTR(W.STMT_TEXT,1,50) AS STMT_TEXT
FROM TABLE(MON_GET_ACTIVITY(NULL, -2)) AS T,
SYSCAT.SERVICECLASSES AS U,
SYSIBMADM.MON_CURRENT_UOW AS V,
TABLE(MON_GET_PKG_CACHE_STMT(NULL, T.EXECUTABLE_ID, NULL, -1)) AS W
WHERE T.SERVICE_CLASS_ID = U.SERVICECLASSID
AND T.APPLICATION_HANDLE = V.APPLICATION_HANDLE
Which gives output like this:
Hope this helps!