Query Monitor Subsystem

The Query Monitor Subsystem is a component of Db2 Query Monitor that integrates the data collected by the CQC to provide a complete picture of query activity in a monitored Db2 subsystem.

A Query Monitor Subsystem can run as either a started task or as a batch job under the control of JES. To run the Query Monitor Subsystem as a started task, the started task JCL must reside in a cataloged procedure library. You can customize the started task JCL, CQMPROC, for a specific installation of Db2 either using Tools Customizer or by customizing SCQMSAMP data set member CQMPROC.

The Query Monitor Subsystem contains a CQMPARMS DD statement that points to the Db2 Query Monitor control data set that in turn contains Db2 Query Monitor parameter file, CQMPARMS. CQMPARMS defines the Query Monitor Subsystem ID (QMID) that identifies the Query Monitor Subsystem. You can customize CQMPARMS for a specific installation of Db2 Query Monitor either using Tools Customizer or by customizing SCQMSAMP data set member CQMPARMS.

Query Monitor subsystem data collection

The Query Monitor Subsystem collects data, manages intervals, archives historical data, and installs/removes the required instrumentation components. Data collection consists of the following components:

  • Address space initialization
  • Control block allocation
  • Address space termination and cleanup
  • Db2 discovery
  • Instrumentation install and uninstall
  • First-level data summarization
  • Performance history file population and management
  • Exception recognition and notification
  • SQL alert recognition and notification
  • Field diagnostic generation
  • Interval processing
  • Historical data archival
  • Historical data archive history maintenance

Monitoring more than one Db2 subsystem

A Query Monitor Subsystem can monitor one to 64 Db2 subsystems on an LPAR. A minimal implementation consists of one Query Monitor Subsystem per LPAR. An extremely granular implementation uses one Query Monitor Subsystem to monitor each Db2 subsystem.

If you use several Db2 Data Access Common Collector products (CQM or Guardium S-TAP for Db2) or several instances of the same product to monitor more than one Db2 subsystem on the same LPAR, each product (or instance of a product) can have a different value for the MASTER_PROCNAME parameter. This configuration is appropriate when running code at different maintenance levels on the same LPAR (for example, if you are testing new maintenance prior to upgrading your production system).

Running multiple Query Monitor Subsystems

Multiple Query Monitor Subsystem can run concurrently on a single z/OS® image if each Query Monitor Subsystem monitors a different Db2 subsystem.

Two Query Monitor Subsystem cannot monitor the same Db2 subsystem.

Each Query Monitor Subsystem must have a unique ID and started task JCL associated with it. The started task JCL must point to:

DB2PARMS
The Db2 control file. DB2PARMS defines the connections to Db2 . There should be only one Db2 control file for your enterprise, if possible.
CQMPARMS
The Db2 Query Monitor parameter file. You must use a unique CQMPARMS file for each Query Monitor Subsystem.
CQMINTER
The Db2 Query Monitor interval data set. You must use a unique CQMINTER data set for each Query Monitor Subsystem.
CQMPROFS
The Db2 Query Monitor monitoring profile data set. In most situations, is preferable that you use a single CQMPROFS data set for all Query Monitor Subsystems. In certain situations, multiple CQMPROFS data sets are used, for example, if you have one CQMPROFS for DEV and another for PROD.

Monitoring the same Db2 subsystem with multiple Db2 Data Access Common Collector products

If you use multiple Db2 Data Access Common Collector products (CQM or Guardium S-TAP for Db2) to monitor the same Db2 subsystem, each product must specify the same value for the MASTER_PROCNAME parameter.