Sunday 9 December 2012

Identify which db2 agent is consuming high CPU

Performance is a key thing in database world and its always a bottleneck area for OLTP system. If you happen to stuck in a scenario to identify which agentid is taking high CPU, here is the SQL :


select APPL.agent_id,appl_status,appl_con_time,
(( ( appl.agent_usr_cpu_time_s *1000000) + appl.agent_usr_cpu_time_ms) + ((appl.agent_sys_cpu_time_s * 1000000) + appl.agent_sys_cpu_time_ms)) CPU_Ms
,appl_name,primary_auth_id,client_nname,execution_id from
sysibmadm.snapappl APPL, sysibmadm.snapappl_info INFO where appl.agent_id=INFO.agent_id

It provides the cpu consumption in macro-seconds since the time it has connected.

No comments:

Post a Comment