Db2 Long Running Queries Test

Nothing can degrade the performance of the server like a resource-hungry or a long-running query! When such queries execute on the server, they either hog almost all the available CPU, memory, and disk resources or keep the resources locked for long time periods, thus leaving little to no resources for carrying out other critical database operations. This can significantly slowdown the database server and adversely impact user experience with the server. To ensure peak performance of the DB2 UDB server at all times, such queries should be rapidly identified and quickly optimized to minimize resource usage. This can be done using the Db2 Long Running Queries test.

This test auto-discovers the DB2 UDB database instances, tracks the currently executing queries on each database and determines the number of queries that have been running for a long time.

Target of the test : A DB2 database server

Agent deploying the test : An internal agent

Outputs of the test : One set of results for every database on the DB2 database server that is currently active

Configurable parameters for the test
Parameter Description

Test period

How often should the test be executed

Host

The IP address of the DB2 server

Port

  • The port number through which the DB2 server communicates. The default port is 50000.
  • User

    Specify the name of the user who is authorized to access the target database server and collect the required metrics in this text box. You can create a separate user on the OS hosting the DB2 server for this purpose. The steps for the same are detailed in the Creating a Special User for Monitoring DB2 Server topic.

    Password

    Enter the password of the specified USER in the PASSWORD text box.

    Confirm Password

    Confirm the Password by retyping it in the Confirm Password text box.

    Database

    Specify the name of the database on the monitored DB2 server to be used by this test.

    Include DB

    Specify a comma-separated list of databases that you wish to monitor in the Include DB text box.

    Exclude DB

    Specify a comma-separated list of databases that need to be excluded from monitoring in the Exclude DB text box.

    Elapsed Time (Seconds)

    There is a specified duration (in seconds) for which the query should have executed to be regarded as long running query. Specify the duration in Elapsed Time (Seconds) text box. The default value is 10.

    Exclude User

    Specify a comma-separated list of users that you wish to exclude from the list of long running queries. By default, this parameter is set to none.

    Exclude Command

    Specify the command you wish to exclude from the list of long running queries. For example, if you wish to exclude long running queries related to backup, then specifying backup against this text box will exclude those queries from being considered as long-running queries. By default, this parameter set to none.

    SSL

    If the target database server is SSL-enabled, then set the SSL flag to Yes. If not, then set the SSL flag to No.

    Trust Store File Name

    This parameter is applicable only if the target DB2 UDB database is SSL-enabled, if not, set this parameter to none. Specify the file name of the client-side SSL truststore that contains the server certificate required for establishing an SSL connection. The truststore is used to verify the identity of the server and enable a secure communication channel.

    By default, the truststore file should be placed in:<EG_INSTALL_DIR>/jre/lib/security/mytruststore.jks

    Here, mytruststore.jks is the Truststore file name. You may change this to any valid file name. By default, none is specified against this text box.

    Trust Store Password

    This parameter is applicable only if the target DB2 UDB database is SSL-enabled, if not, set this parameter to none. If a Truststore File name is provided, then, in this text box, provide the password that is used to obtain the associated certificate details from the Truststore File. By default, this parameter is set to none.

    Confirm Password

    Confirm the Password by retyping it in the Confirm Password text box.

    DD Row Count

    By default, the detailed diagnosis of this test, if enabled, will report only the top-5 long running queries. This is why, the DD Row Count parameter is set to 5 by default. If you want to include more or less long running queries in detailed diagnosis, then change the value of this parameter accordingly.

    Detailed Diagnosis

    To make diagnosis more efficient and accurate, the eG Enterprise embeds an optional detailed diagnostic capability. With this capability, the eG agents can be configured to run detailed, more elaborate tests as and when specific problems are detected. To enable the detailed diagnosis capability of this test for a particular server, choose the On option. To disable the capability, click on the Off option.

    The option to selectively enable/disable the detailed diagnosis capability will be available only if the following conditions are fulfilled:

    • The eG manager license should allow the detailed diagnosis capability
    • Both the normal and abnormal frequencies configured for the detailed diagnosis measures should not be 0.
    Configurable parameters for the test
    Parameter Description

    Test Period

    How often should the test be executed.

    Host

    Specify the IP address of the DB2 server in this text box.

    Port

    Specify the port at which the target host is listening. The default port is 50000.

    Username, Password and Confirm Password

    To monitor Db2 UDB database server, the eG agent should be configured with the credentials of a user with any of the following privileges SYSADM or SYSCTRL or SYSMAINT or SYSMON. Specify the credentials of such a user in the User and Password text boxes. Confirm the Password by retyping it in the Confirm Password text box.

    Database

    The test uses a database on the monitored Db2 UDB server. Specify the name of the database in the Database text box.

    Include DB

    Specify the list of databases that you wish to monitor in a comma-seperated list in the Include DB text box. By default this is set to ALL.

    Exclude DB

    Specify the list of databases that you wish to exclude from monitoring in a comma-seperated list in the Exclude DB text box. By default this is set to NONE.

    Elapsed Time (Seconds)

    There is a specified duration (in seconds) for which the query should have executed to be regarded as long running query. Specify the duration in Elapsed Time (Seconds) text box. The default value is 10.

    SSL

    If the target database server monitored is SSL-enabled, then set the SSL flag to Yes. If not, then set the SSL flag to No.

    Trust Store file name

    The trust store file contains certificates from trusted Certificate Authorities (CAs). These certificates are used by eG agent to verify the authenticity of servers hosting DB2 UDB and establish a secure connection with the server using SSL. Specify the filename for Trust store file in Trust Store file name text box.

    Trust Store Password

    The trust store password is the passphrase or key used to encrypt and decrypt the trust store file. This password is required by the eG Agent when it needs to access the trust store file to establish secure connections. Specify the password in Trust Store password text box.

    Confirm Password

    Confirm the Password by retyping it in the Confirm Password text box.

    DD Row Count

    The number of rows to be displayed in DD page is entered in the DD Row Count text box. By default the value is set to 5.

    Detailed Diagnosis

    To make diagnosis more efficient and accurate, the eG Enterprise embeds an optional detailed diagnostic capability. With this capability, the eG agents can be configured to run detailed, more elaborate tests as and when specific problems are detected. To enable the detailed diagnosis capability of this test for a particular server, choose the On option. To disable the capability, click on the Off option.

    The option to selectively enable/disable the detailed diagnosis capability will be available only if the following conditions are fulfilled:

    • The eG manager license should allow the detailed diagnosis capability
    • Both the normal and abnormal frequencies configured for the detailed diagnosis measures should not be 0.
    Measures made by the test:

    Measurement

    Description

    Measurement Unit

    Interpretation

    Number of long run query

    Indicates the number of queries currently executing on this database that have been running for more time than the configured ELAPSED TIME.

    Number

    The detailed siagnosis of this measure shows the name and ID of application, name of the user, time takne in seconds, CPU time in seconds, query cost estimation, number of reads and writes and SQL text.

    Maximum elapsed time

    Indicates the maximum time taken by this database for executing the queries.

    Seconds

    Ideally, a low value is desired for this measure.