Setting up dmctop

The dmctop utility is a lightweight, low overhead monitoring tool that works in a text-only environment.

Beginning with IBM® Db2® Data Management Console v3.1.5, the monitoring utility dmctop v1.0.2 is bundled with Db2 v11.5.6.

Note: The dmctop utility is supported only on Power® 8 and later processors.

Dependency

The dmctop utility has dependency on Db2 CLI driver.

  1. Download the IBM Data Server Driver for ODBC and CLI.
    1. Go to the IBM Support Fix Central website:
    2. Select Information Management from the Product Group drop down box.
    3. Select the IBM Data Server Client Packages from the Select from Information Management drop-down box.
    4. Select the IBM Data Server Driver for ODBC and CLI product version that you require from the Installed Version drop-down box.
    5. Select the platform from the Platform drop-down box then click Continue.

      A list of all client and driver packages available for your platform, including IBM Data Server Driver for ODBC and CLI will be displayed.

  2. Install the driver manually:
    1. Copy the compressed file that contains the driver to the target system.
    2. Select an install directory in the target system and uncompress the file.
    3. Optional: Remove the compressed file.
    4. Setup an environment variable
      For Linux®/AIX®:
      LD_LIBRARY_PATH=<DRIVER_INSTALL_PATH>/lib
      For MacOS:
      DYLD_LIBRARY_PATH=<DRIVER_INSTALL_PATH>/lib
      For Windows:
      PATH=%PATH%;<DRIVER_INSTALL_PATH>\bin

Downloading dmctop

You can download dmctop from Db2 Download Center website.

Running dmctop from Db2 server

When running on database server, dmctop connects to local database without requiring credentials. dmctop uses existing ODBC driver on the server hence installation of separate ODBC driver is not required.
Note: Db2 v11.5.5. databases only contain dmctop v1.0.0.0 on Linux and Windows operating systems.
  1. Copy dmctop on server under the desired location.
    Note: If you want to use dmctop v1.0.0.0 for Db2 v11.5.5. databases, skip step1 and go directly to step 2.
  2. Run the dmctop .
    For Linux/AIX/MacOS:
    dmctop -d SAMPLE
    For Windows:
    dmctop.exe -d SAMPLE

Run dmctop remotely

The easiest way to run dmctop is to fully specify the database and user credentials. The dmctop utility will use the CLI driver.

For Linux/AIX/MacOS:
dmctop -d <database_name> -n <host_name> -r <port_number> -u <user_id> [-cert-path Root-CA certificate absolute path]
For Windows:
dmctop.exe -d <database_name> -n <host_name> -r <port_number> -u <user_id> [-cert-path Root-CA certificate absolute path]

For example:

For Linux/AIX/MacOS:
dmctop -d SAMPLE -n localhost -r 50000 -u db2inst1
For Windows:
dmctop.exe -d SAMPLE -n localhost -r 50000 -u db2inst1
By default dmctop uses secure connection, if databases is configured with internal CA signed certificate then it needs to be provided with specified option.

For example:

For Linux/AIX/MacOS:
dmctop -d SAMPLE -n localhost -r 50000 -u db2inst1 -cert-path \home\db2inst1\ssl\inernal-CA.arm
For Windows:
Windows: dmctop.exe -d SAMPLE -n localhost -r 50000 -u db2inst1 -cert-path C:/ssl/inernal-CA.arm

If SSL is not configured for databases then -insecure option can be used to disable default secure connection.

For example:

For Linux/AIX/MacOS:
dmctop -d SAMPLE -n localhost -r 50000 -u db2inst1 -insecure
For Windows:
dmctop.exe -d SAMPLE -n localhost -r 50000 -u db2inst1 -insecure

dmctop requires a password. You can specify the password on the command line with -p. However, this is not recommended as the password will then be visible to other users running similar commands.

For example:

For Linux/AIX/MacOS:
dmctop -d SAMPLE -n localhost -r 50000 -u db2inst1 -p <password>
For Windows:
dmctop.exe -d SAMPLE -n localhost -r 50000 -u db2inst1 -p <password>

Run dmctop in background mode

When using the -b parameter, dmctop saves information to file in CSV format. Issuing multiple sub-options for background mode (-b) is not supported.

The -b parameter takes one of the following single character sub-option values

d - overview

l - connections

a - top consumer activities

J - Skew monitor

s - in-flight statements

D - Package cache

L - Lock statistics

m - DB memory

I - Instance memory

F - Federation

A - HADR

For example:

Using default file name

For Linux/AIX/MacOS:
dmctop -d SAMPLE -n localhost -r 50000 -u db2inst1 -insecure -b d
For Windows:
dmctop.exe -d SAMPLE -n localhost -r 50000 -u db2inst1 -insecure -b d

Specifying output file name

For Linux/AIX/MacOS:
dmctop -d SAMPLE -n localhost -r 50000 -u db2inst1 -insecure -b d -f <outputFile>.csv
For Windows:
dmctop.exe -d SAMPLE -n localhost -r 50000 -u db2inst1 -insecure -b d -f <outputFile>.csv

Running dmctop on a remote system using PuTTY

  1. Check the system character set by running localectl status in the remote system. For example:
    # localectl status
       System Locale: LANG=en_US.UTF-8
           VC Keymap: us
          X11 Layout: us
  2. In the PuTTY Configuration window, under the Category menu, go to Window > Translation and verify whether the value for Remote character set option is the one that is specified on your remote system.
  3. Set the terminal-type string to accept more colors. In the PuTTY Configuration window, under the Category menu, go to Window > Data and enter the value xterm-256color in the Terminal-type string option.