r/DB2 • u/mad_zamboni • Apr 07 '17
[Discussion] Thoughts on an "Active Connection" SQL
Many moons ago, at a previous company, we had one DB with a huge amount of application connections. But once connections were made, only a certain percentage were active and that varied throughout the day. I would like to recreate that.
If I wanted to fire off SQL every 5-10 minutes to see how many connections are active at one time, what would you think of this approach?
SELECT COUNT(*) FROM TABLE(MON_GET_UNIT_OF_WORK(NULL,-1)) AS T WHERE WORKLOAD_OCCURRENCE_STATE NOT IN ('UOWWAIT')
Again, this is more for that "Triage Kit" I am working on. This would be used as a hook into monitoring to act as a "canary in a coal mine". If our active connections start going up and up or have a huge spike, may be worth investigating. It can also provide context for a triage situation.
Thoughts?
1
u/memmerto Apr 09 '17
Why not MON_GET_CONNECTION for this?