
Chapter 6. Custom Database Monitor Analysis 199
To get the duration of the Database Monitor data collection for the job, select the job number
as shown in Example 6-16. For qqjnum = '999999', substitute the job number.
Example 6-16 Duration of the Database Monitor collection for one job
SELECT MIN(qqtime) "Start Time", MAX(qqtime) "End Time",
MAX(qqtime) - MIN(qqtime) "Duration (Sec)"
FROM mydbmon WHERE qqrid<>3018 and qqjnum = '999999';
You can also find the total number of seconds spent by using the SQL statement shown in
Example 6-17.
Example 6-17 Time spent in SQL
SELECT SUM(qqi6)/1000000 "Total Time (Sec)" FROM mydbmon
WHERE qqrid=1000;
If stored ...