CL Command Reference - STRDBMON

CL Command List > STRDBMON Reference

Description:

The Start Database Monitor (STRDBMON) command starts the collection of database performance statistics for a specified job, for all jobs on the system or for a selected set of jobs. The statistics are placed in a user-specified database file and member. If the file or member do not exist, one is created based on the QAQQDBMN file in library QSYS. If the file or member do exist, the record format of the specified file is verified to insure it is the same.

For each monitor started using the STRDBMON commmand, the system generates a monitor ID that can be used to uniquely identify each individual monitor. The monitor ID can be used on the ENDDBMON command to uniquely identify which monitor is to be ended. The monitor ID is returned in the informational message CPI436A which is generated for each occurrence of the STRDBMON command. The monitor ID can also be found in column QQC101 of the QQQ3018 database monitor record.

Restrictions:

1. There are two types of monitors. A private monitor is a monitor over one, specific job (or the current job). A public monitor is a monitor which collects data across mulitple jobs. Only one (1) monitor can be started on a specific job at a time (i.e. only one private monitor can be active over any specific job). For example, STRDBMON JOB(*) followed by another STRDBMON JOB(*) within the same job is not allowed. There can be a maximum of ten (10) public monitors active at any one time. For example, STRDBMON JOB(*ALL) followed by another STRDBMON JOB(*ALL) is allowed providing the maximum number of public monitors does not exceed 10. You may have 10 public monitors and 1 private monitor active at the same time for any specific job.

2. If multiple monitors specify the same output file, only one copy of the database statistic records will be written to the specified output file for each job. For example, STRDBMON OUTFILE(LIB/TABLE1) JOB(*) and STRDBMON OUTFILE(LIB/TABLE1) JOB(*ALL) both use the same output file. For the current job, you will not get two copies of the database statistic records, one copy for the private monitor and one copy for the public monitor. You will get only one copy of the database statistic records.

3. QTEMP cannot be specified as the library on the OUTFILE parameter unless JOB(*) was also specified.

4. This command is conditionally threadsafe. For multithreaded jobs, this command is not threadsafe and may fail when the OUTFILE parameter is a distributed file or is a Distributed Data Management (DDM) file of type *SNA. 5. Any public monitor requires the file specified for the OUTFILE parameter to be in a library that resides in the system ASP.


Examples:

Example 1: Starting Database Monitoring For All Jobs

STRDBMON OUTFILE(QGPL/FILE1) OUTMBR(MEMBER1 *ADD)
JOB(*ALL) FRCRCD(10)

This command starts database monitoring for all jobs on the system. The performance statistics are added to the member named MEMBER1 in the file named FILE1 in the QGPL library. Ten records will be held before being written to the file.



Example 2: Starting Database Monitoring For a Specific Job

STRDBMON OUTFILE(*LIBL/FILE3) OUTMBR(MEMBER2)
JOB(134543/QPGMR/DSP01) FRCRCD(20)

This command starts database monitoring for job number 134543. The job name is DSP01 and was started by the user named QPGMR. The performance statistics are added to the member named MEMBER2 in the file named FILE3. Twenty records will be held before being written to the file.



Example 3: Starting Database Monitoring For a Specific Job to a File in a Library in an Independent ASP

STRDBMON OUTFILE(LIB41/DBMONFILE) JOB(134543/QPGMR/DSP01)

This command starts database monitoring for job number 134543. The job name is DSP01 and was started by the user named QPGMR. The performance statistics are added to the member name DBMONFILE (since OUTMBR was not specified) in the file named DBMONFILE in the library named LIB41. This library may exist in more than one independent auxiliary storage pool (ASP); the library in the name space of the originator¡¯s job will always be used.



Example 4: Starting Database Monitoring For All Jobs That Begin With ¡¯QZDA¡¯

STRDBMON OUTFILE(LIB41/DBMONFILE) JOB(*ALL/*ALL/QZDA*)

This command starts database monitoring for all jobs that whose job name begins with ¡¯QZDA¡¯. The performance statistics (monitor records) are added to member DBMONFILE (since OUTMBR was not specified) in file DBMONFILE in library LIB41. This library may exist in more than one independent auxiliary storage pool (ASP); the library in the name space of the originator¡¯s job will always be used.



Example 5: Starting Database Monitoring For All Jobs and Filtering SQL Statements That Run Over 10 Seconds

STRDBMON OUTFILE(LIB41/DBMONFILE) JOB(*ALL) RUNTHLD(10)

This command starts database monitoring for all jobs. Monitor records are created only for those SQL statements whose estimated run time meets or exceeds 10 seconds.



Example 6: Starting Database Monitoring For the Current Job and Filtering Over a Specific File

STRDBMON OUTFILE(LIB41/DBMONFILE) JOB(*) FTRFILE(LIB41/TABLE1)

This command starts database monitoring for the current job. Monitor records are created only for those SQL statements that use file LIB41/TABLE1.



Example 7: Starting Database Monitoring For the Current Job and the Current User

STRDBMON OUTFILE(LIB41/DBMONFILE) JOB(*) FTRUSER(*CURRENT)

This command starts database monitoring for the current job. Monitor records are created only for those SQL statements that are executed by the current user.



Example 8: Starting Database Monitoring For Jobs Beginning With ¡¯QZDA¡¯ and Filtering Over Run Time and File

STRDBMON OUTFILE(LIB41/DBMONFILE) JOB(*ALL/*ALL/QZDA*)
RUNTHLD(10) FTRUSER(DEVLPR1) FTRFILE(LIB41/TTT*)

This command starts database monitoring for all jobs whose job name begins with ¡¯QZDA¡¯. Monitor records are created only for those SQL statements that meet all of the following conditions:
. The estimated run time, as calculated by the query optimizer, meets or exceeds 10 seconds
. Was executed by user ¡¯DEVLPR1¡¯.
. Use any file whose name begins with ¡¯TTT¡¯ and resides in library LIB41.