IBM DB2 Performance Monitoring

Drill down into the performance of your DB2 database by getting to know bufferpool, transaction, log utilization stats and more.

Detect database outages and failures faster by monitoring DB2 database with Site24x7 plugins. Use these key indicators to ensure continuous functioning of your DB2 servers. You can also monitor custom queries from your DB2 database tables and track business-critical KPIs with the IBM DB2 custom database query plugin.

DB2 performance monitoring metrics

Use our wide array of metrics and get notified of hazardous errors that require your attention. DB2 monitoring helps to keep track of unexpected trends through our metric graphs and troubleshoot as quickly as possible. Various out-of-the-box metrics we support are:

Number of bufferpools

The bufferpool is a part of the main memory space allocated by the database manager. The purpose of the bufferpool is to cache entries and their attributes. The number_of_bufferpools helps to efficiently optmize the memory used by the database and increase its overall performance

Total logical reads

total_logical_reads is the sum of data, index and XDA logical reads

Total physical reads

total_physical_reads is the sum of physical reads of data, index and XDA

Total hit ratio percentage

The total_hit_ratio_percent is a measure of how often a page access is satisfied without requiring an input/output operation

Data logical/physical reads

The data_logical_reads and data_physical_reads gives the sum of data logical and physical reads respectively in the DB2 server

Data hit ratio percentage

data_hit_ratio_percent is the individual hit ratio percentage specific for data bufferpool

Index logical reads and hit ratio percentage

index_logical_reads gives the index bufferpool logical reads and index_hit_ratio_percent is the index bufferpool hit ratio percentage

XDA logical reads and hit ratio percentage

xda_logical_reads gives the XDA index logical reads and xda_hit_ratio_percent is the XDA hit ratio percentage

Custom database queries

Custom SQL queries that get executed and the results are displayed as performance data to track business-critical KPIs

Prerequisites

Install the IBM DB2 database server monitoring plugin to track the availability and performance of DB2 servers.

  • Download and install the Site24x7 server monitoring agent (Linux | Windows) in the server where you plan to run the plugin.
  • Ensure you have Python 3 or a higher version installed in your server.
  • Ensure you have the ibm_db module for Python installed in your server.
    If it is not installed, execute the following command on your server to install it:
    pip install ibm_db
  • Provide the DBADM authority role to the IBM DB2 user to access performance metrics from the database.

Install the IBM DB2 custom database query plugin and monitor SQL queries to track business-critical KPIs from your IBM DB2 database tables. The plugin executes a given query and displays the result as performance data. The column name will be displayed as the metric name and the corresponding value of the column will be displayed as the metric value.

  • Download and install the Site24x7 server monitoring agent (Linux | Windows) in the server where you plan to run the plugin.
  • Ensure you have Python 3 or a higher version installed in your server.
  • Ensure you have the ibm_db module for Python installed in your server.
    If it is not installed, execute the following command on your server to install it:
    pip install ibm_db

Install the IBM DB2 tablespace plugin to monitor DB2 database tablespaces.

  • Download and install the Site24x7 server monitoring agent (Linux | Windows) in the server where you plan to run the plugin.
  • Ensure you have Python 3 or a higher version installed in your server.
  • Ensure you have the ibm_db module for Python installed in your server.
    If it is not installed, execute the following command on your server to install it:
    pip install ibm_db
  • Provide the DBADM authority role to the IBM DB2 user to access performance metrics from the database.

Plugin installation

  • Create a folder named ibmdb2.
  • Download the ibmdb2.py and the ibmdb2.cfg files from our GitHub repository and place them in the ibmdb2 folder.
    wget https://raw.githubusercontent.com/site24x7/plugins/master/ibmdb2/ibmdb2.py
    wget https://raw.githubusercontent.com/site24x7/plugins/master/ibmdb2/ibmdb2.cfg
  • For Linux servers, follow the steps in this article to update the Python path in the ibmdb2.py script.
  • To check if the plugin is working, execute the command below with appropriate arguments and check for a valid JSON output with applicable metrics and their corresponding values.
    python3 ibmdb2.py --host <hostname> --port <port no> --username <username> --password <password> --sample_db <db name>
  • Add the applicable configurations in the ibmdb2.cfg file.
    [ibm_db_2]
    host = "<hostname>"
    port = "<port>"
    username = "<username>"
    password = "<password>"
    sample_db = "<sample_db>"
  • Follow the steps in this article to learn how to run the Python script on a Windows server. You don't need to do this for Linux.
  • Move the ibmdb2 folder to the Site24x7 server monitoring plugin directory.

    For Linux: /opt/site24x7/monagent/plugins/

    For Windows: C:\Program Files (x86)\Site24x7\WinAgent\monitoring\plugins\

The agent will automatically execute the plugin within five minutes and display the performance data in Site24x7.
To view the plugin monitor and associated performance charts:
  • Log in to Site24x7.
  • Navigate to Plugins and click the required monitor.
  • Create a folder named ibmdb2_custom_query.
  • Download the ibmdb2_custom_query.py and the ibmdb2_custom_query.cfg files from our GitHub repository and place them in the ibmdb2_custom_query folder.
    wget https://raw.githubusercontent.com/site24x7/plugins/master/ibmdb2_custom_query/ibmdb2_custom_query.py
    wget https://raw.githubusercontent.com/site24x7/plugins/master/ibmdb2_custom_query/ibmdb2_custom_query.cfg
  • To check if the plugin is working, execute the command below with appropriate arguments and check for a valid JSON output with applicable metrics and their corresponding values.
    python3 ibmdb2_custom_query.py --host <hostname> --port <port no> --username <username> --password <password> --sample_db <db name> --query <db2 query>
  • Add the applicable configurations in the ibmdb2_custom_query.cfg file.
    [ibm_db_2]
    host = "<hostname>"
    port = "<port>"
    username = "<username>"
    password = "<password>"
    sample_db = "<sample_db>"
    query = "<DB2 Query>"
  • Follow the steps in this article to learn how to run the Python script on a Windows server. You don't need to do this for Linux.
  • Move the ibmdb2_custom_query folder to the Site24x7 server monitoring plugin directory.

    For Linux: /opt/site24x7/monagent/plugins/

    For Windows: C:\Program Files (x86)\Site24x7\WinAgent\monitoring\plugins\

The agent will automatically execute the plugin within five minutes and display the performance data in Site24x7.
To view the plugin monitor and associated performance charts:
  • Log in to Site24x7.
  • Navigate to Plugins and click the required monitor.
  • Create a folder named ibmdb2_tablespace.
  • Download the ibmdb2_tablespace.py and the ibmdb2_tablespace.cfg files from our GitHub repository and place them in the ibmdb2_tablespace folder.
    wget https://raw.githubusercontent.com/site24x7/plugins/master/ibmdb2/ibmdb2_tablespace/ibmdb2_tablespace.py
    wget https://raw.githubusercontent.com/site24x7/plugins/master/ibmdb2/ibmdb2_tablespace/ibmdb2_tablespace.cfg
  • For Linux servers, follow the steps in this article to update the Python path in the ibmdb2_tablespace.py script.
  • To check if the plugin is working, execute the command below with appropriate arguments and check for a valid JSON output with applicable metrics and their corresponding values.
    python3 ibmdb2_tablespace.py --host <hostname> --port <port no> --username <username> --password <password> --sample_db <db name> --tbsp_name <tablespace name>
  • Add the applicable configurations in the ibmdb2_tablespace.cfg file.
    [ibm_db_2]
    host = "<hostname>"
    port = "<port>"
    username = "<username>"
    password = "<password>"
    sample_db = "<sample_db>"
    tbsp_name = "<tablespace name>"
  • Follow the steps in this article to learn how to run the Python script on a Windows server. You don't need to do this for Linux.
  • Move the ibmdb2_tablespace folder to the Site24x7 server monitoring plugin directory.

    For Linux: /opt/site24x7/monagent/plugins/

    For Windows: C:\Program Files (x86)\Site24x7\WinAgent\monitoring\plugins\

The agent will automatically execute the plugin within five minutes and display the performance data in Site24x7.
To view the plugin monitor and associated performance charts:
  • Log in to Site24x7.
  • Navigate to Plugins and click the required monitor.

Related plugins

  • ActiveMQ plugin - Monitor performance metrics of your Apache ActiveMQ instances
  • GlassFish plugin - Monitor performance metrics of your GlassFish servers
  • Kafka plugin - Analyze performance of your Apache Kafka server
  • Nagios plugin - Execute thousands of Nagios plugins in Site24x7 without the need of running a Nagios server
  • Out-of-the-box plugins - Monitor your entire app stack with our extensive list of integrations
  • Create custom plugins - Create custom Linux and Windows plugins and monitor custom attributes