STRDBMON (Start Database Monitor)

STRDBMON Command syntax diagram

 

Purpose

The Start Database Monitor (STRDBMON) command starts the collection of database performance statistics for a specified job or all jobs on the system. The statistics are placed in a 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 file is checked to see if it is the same.

 

Restrictions

  1. You cannot specify *ALL on the JOB parameter if the monitor has already been started with the JOB(*ALL) attribute. Only one specific monitor can be started on a specific job at a time. For example, STRDBMON JOB(*) followed by another STRDBMON JOB(*) within the same job is not allowed unless the job was ended using ENDDBMON between the two STRDBMON command operations.
  2. QTEMP cannot be specified as the library on the OUTFILE parameter unless JOB(*) was also specified.
  3. You must have job control (*JOBCTL) special authority to start a monitor for a job other than the current job.
  4. For multithreaded jobs, this command is not threadsafe and may fail when the OUTFILE parameter is a distributed file or a Distributed Data Management (DDM) file of type *SNA.
  5. JOB(*ALL) requires the file specified on the OUTFILE parameter to be in a library that resides in the system ASP.>

OUTFILE
Specifies the library and file name to which the performance statistics are written. If the file does not exist, one is created based on the QAQQDBMN file in library QSYS.

The name of the file can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

file-name: Specify the name of the file.

OUTMBR
Specifies the member name of the specified file to use for output. If the specified member does not exist, one is created.

Element 1: Member to Receive Output

*FIRST: The first member in the file receives the output. If OUTMBR(*FIRST) is specified and the member does not exist, the system creates a member with the name of the file specified on the OUTFILE parameter.

member-name: Specify the member name.

Element 2: Action on Member

*REPLACE: The system clears the existing member and adds the new records.

*ADD: The new records are added to the existing information in the specified database file member.

JOB
Specifies the qualified name of the job and consists of as many as three elements. For example:
job-name
user-name/job-name
job-number/user-name/job-name

*N may be used in place of the user-name element to maintain position in the sequence. More information on this parameter is in Commonly used parameters.

*: The current job is monitored.

*ALL: All jobs on the system are monitored, including jobs waiting on job queues.

job-name: Specify the name of the job whose monitor is started.

user-name: Specify the name of the user of the job whose monitor is started.

job-number: Specify the number of the job whose monitor is started.

TYPE
Specifies the type of database records to place in the outfile.

*SUMMARY: Only the summary database monitor records are collected.

*DETAIL: Both detail and summary database monitor records are collected.

FRCRCD
Specifies the number of records to hold in the buffer before forcing the records to be written to the file.

*CALC: The command will calculate the number of records to use as this value.

number-of-records: Specify the number of records to hold. Valid values range from 0 through 32767.

COMMENT
Specifies the description that is associated with the database monitor record whose ID is 3018.

*BLANK: Text is not specified.

text: Specify up to 100 characters of text.

Examples for STRDBMON

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 ASP (auxiliary storage pool); the library in the namespace of the originator's job will always be used.>

Error messages for STRDBMON

*ESCAPE Messages

CPF1321
Job &1 user &2 job number &3 not found.
CPF436B
&1 can not be specified on the OUTFILE parameter.
CPF436C
Job &4 is already being monitored.
CPF436E
Job &1 user &2 job number &3 is not active.