Monitoring metrics for Db2 workload management

Monitoring metrics provide data about the health of and query performance on your Db2 data server, which can then be used as input to a 3rd party tool or in conjunction with additional scripting you provide to analyze the metrics returned.

Metrics are maintained for a number of Db2 database objects. These metrics reside in memory and can be viewed in real-time using Db2 monitoring metrics table functions, or the metrics can be collected and sent to an event monitor where they can be viewed later for historical analysis.

Monitoring metrics for activities

You can obtain monitoring metrics for activities using:
  • The activities event monitor (the ACTIVITYMETRICS table or the DETAILS_XML column of the ACTIVITY table)
  • The MON_GET_ACTIVITY_DETAILS table function

Monitoring metrics for activities are controlled by the mon_act_metrics database configuration parameter and the COLLECT ACTIVITY METRICS clause on a workload. Metrics will be collected for an activity, if the database configuration parameter is set to a value other than NONE or if the activity is submitted by a connection that is associated with a workload which has a COLLECT ACTIVITY METRICS setting other than NONE.

You can use workload-level controls to achieve better monitoring granularity, if you do not want to collect metrics for all activities. If activity metrics collection is enabled at the database level (enabled by default), then metrics are collected for all activities, regardless of the setting at the workload level.

See the monitoring documentation for more details.

System-level monitoring metrics

Use the following objects to obtain system-level monitoring metrics aggregated by service classes and workloads:
  • The statistics event monitor:
    • The details_xml and metrics monitor elements in the EVENT_SCSTATS and EVENT_WLSTATS logical data groups
    • Individual monitor elements in the EVENT_SCMETRICS and EVENT_WLMETRICS logical data groups
  • The following table functions:
    • MON_GET_SERVICE_SUBCLASS
    • MON_GET_SERVICE_SUBCLASS_DETAILS
    • MON_GET_SERVICE_SUPERCLASS
    • MON_GET_SERVICE_SUPERCLASS_DETAILS
    • MON_GET_WORKLOAD
    • MON_GET_WORKLOAD_DETAILS
Monitoring metrics for requests to the data server, including those requests that are part of an activity, are controlled by the mon_req_metrics database configuration parameter and the COLLECT REQUEST METRICS clause on a service superclass. Metrics are collected for a request if either of the following conditions are met:
  • The database configuration parameter is set to a value other than NONE.
  • The request is submitted by a connection that mapped to a subclass under a superclass that has a COLLECT COLLECT REQUEST METRICS setting other than NONE.

You can use service superclass-level controls to achieve better monitoring granularity, if you do not want to collect metrics for all requests. If request metrics collection is enabled at the database level (enabled by default), then metrics are collected for all requests, regardless of the setting at the service superclass level.

Note that the metrics from background EDUs such as prefetchers and page cleaners are not rolled up to workloads or service classes.

See the monitoring documentation for more details.