Enabling Db2 Warehouse monitoring

You can use the db2mon tool to collect monitoring data on your Db2 Warehouse databases in Cloud Pak for Data.

About this task

A db2mon.sh shell script provides a sampling of data collection and analysis. The script also checks that the prerequisites for db2mon are met. The db2mon.sh script is packaged with Db2 Warehouse and can be found in the ${BLUMETAHOME}/db2inst1/sqllib/samples/perf/ directory.

For more information, see Collecting and reporting performance monitor data with db2mon.

Procedure

  1. Log into the Db2 Warehouse pod:
    oc exec -it db2u-pod -- bash
  2. Log into the Db2 Warehouse instance as the db2inst1 user:
    su - db2inst1
  3. Navigate to the folder where the db2mon.sh script is present
    cd ${BLUMETAHOME}/db2inst1/sqllib/samples/perf/
  4. Issue the following command as the db2inst1 user to run the db2mon.sh script:
    sh db2mon.sh dbname > /tmp/db2mon.out

    where dbname is the name of the database to be monitored.

    By default, the script collects MON_GET data over a 30-second period. The script can take a second optional argument to collect data over a different period, which is specified in seconds. For example, to produce an online report that collects performance data for 120 seconds:

    db2mon.sh dbname 120 > /tmp/db2mon-120s.out
  5. To copy the report from the Db2 Warehouse container to the host, you can run the following command:
    oc cp db2u-podname:/tmp/output-filename destination-path

    where destination-path is the path on the host where you want to copy the report to.