Hello Everyone,
we are using Db2 11.5.9.0 + special_43682, we need to avoid some userid will run SQL queries with ACTIVITYTOTALTIME > 10 SECONDS. What we don't know are the APPLNAME the queries came from and all the userid that could run queries. What we know is that the userid we want to monitor start with the IT characters.
We have configured a THRESHOLD at the moment in COLLECT mode (in the final version we will change in STOP EXECUTION mode).
CREATE THRESHOLD QUERY_RUNNING_10SEC
FOR DATABASE ACTIVITIES
ENFORCEMENT DATABASE
WHEN ACTIVITYTOTALTIME > 10 SECONDS
COLLECT ACTIVITY DATA WITH DETAILS, SECTION AND VALUES
CONTINUE
;
and two EVENT MONITORs to save the information in table.
CREATE EVENT MONITOR STMT_THRESH_VIOLATIONS
FOR THRESHOLD VIOLATIONS
WRITE TO TABLE
AUTOSTART
;
CREATE EVENT MONITOR COLLECT_ACTIVITIES
FOR ACTIVITIES
WRITE TO TABLE
;
With this configuration we are able to identify all the SQL queries with ACTIVITYTOTALTIME > 10 SECONDS that are run from every userid.
From the documentation I understand that to monitor via threshold a specific list of userid I have to configure a custom WORKLOAD and then apply the ACTIVITYTOTALTIME threshold to the WORKLOAD. But we got a problem: it seems that only APPLNAME accepts wildcard in the application names like APPLNAME('DS_ConnMgt*','DSMAu*','DSMOQT','DSMRt*','DSSNAP*','UC_*') instead SESSION_USER no.
Has anyone experienced my same problem ? Our goal is to configure a THRESHOLD that monitor SESSION_USER('IT*') only.
Any suggestion is welcome.
Thanks in advance. Ciao.
Roberto.
------------------------------
Roberto Stradella
------------------------------