Tuesday, July 8, 2014

DB2 Quiz: Processes and CPU

In today's DB2 quiz the focus is on DB2 processes and CPU consumption. Which SQL statement did I run in DB2 for the following output? What function is used?

NAME                                CPU_USER             CPU_SYSTEM         
----------------------------------- -------------------- --------------------
db2fmp (                                              13                    4
db2fmp (                                               9                   10
db2vend (PD Vendor Process - 1) 0                      5                    2
db2ckpwd 0                                             0                   13
db2ckpwd 0                                             0                   13
db2ckpwd 0                                             0                    9
db2sysc 0                                          18561                30282
db2wdog 0 [hloeser]                                    6                   44
db2acd 0                                            6997                11550

  9 record(s) selected.


A statement similar to the one I used can be found in the DB2 Knowledge Center. The statement makes use of a special table function.

2 comments:

Anonymous said...

ENV_GET_DB2_SYSTEM_RESOURCES table function

Henrik Loeser said...

Correct. A query like the following would return the result shown above.

select varchar(db2_process_name,35) as name, cpu_user, cpu_system from table(ENV_GET_DB2_SYSTEM_RESOURCES(-2))

There are several ENV_GET functions in DB2 to interface with the operating system.

Henrik

LinkWithin

Related Posts with Thumbnails