Unanswered: how to measure statement execution time
How can I measure execution time DB2 server spent on queries or insert/update statements? Do I use its mechanism of system monitor? I looked at reference there is "monitor element" called elapsed_exec_time. But I dont know how to use it to check statement run time. It seems difficult for me to understand and work with DB2's "system monitor" Can any one give me any instruction? I only want to know how to get statement execution time. I'm using DB2 V8.1 enterprise edition on Linux.Thanks in advance.
You Can compile the program(say COBOL) with explain plan YES and then monitor the PLAN_TABLE and DSN_STATEMENT_TABLE which will tell u about the query number in program and different statements and its timings in unit PROCSU column.
Or if simply run Set Statementid ='xyz' for select statement and see the corresponding statementid in respective tables.