Monitoring connections by using profiles

You can monitor connections for remote TCP/IP access to Db2 servers. You can use the resulting information to analyze the use of system resources by particular clients, applications, and users. You can also create exception thresholds to prioritize resources accordingly.

Before you begin

Before you can use profiles to monitor threads and connections, create a complete set of profile tables on the Db2 subsystem.

The profile tables and related indexes are created when you run job DSNTIJSG during Db2 installation or migration.

A complete set of profile tables and related indexes includes the following objects:
  • SYSIBM.DSN_PROFILE_TABLE
  • SYSIBM.DSN_PROFILE_HISTORY
  • SYSIBM.DSN_PROFILE_ATTRIBUTES
  • SYSIBM.DSN_PROFILE_ATTRIBUTES_HISTORY
  • SYSIBM.DSN_PROFILE_TABLE_IX_ALL
  • SYSIBM.DSN_PROFILE_TABLE_IX2_ALL
  • SYSIBM.DSN_PROFILE_ATTRIBUTES_IX_ALL

Procedure

To monitor remote connections.

  1. Insert values in the SYSIBM.DSN_PROFILE_TABLE table to create the profile and specify the filtering scope of the profile:
    1. Insert a value in the PROFILEID column to identify the profile.
    2. Insert values to specify the filtering criteria:
      You can specify only IP address or domain name values in the LOCATION column. Other combinations of criteria are not accepted for this monitoring function.
  2. Inserting rows into the SYSIBM.DSN_PROFILE_ATTRIBUTES table to specify the monitoring function of the profile, the type of monitoring and the threshold to monitor:
    1. Insert a value in the PROFILEID column to identify which profiles use this type monitoring function. Insert a value that matches value of the PROFILEID column in the corresponding SYSIBM.DSN_PROFILE_TABLE rows.
    2. Specify the monitoring function by inserting the 'MONITOR CONNECTIONS' value in the KEYWORD column.

      The profile monitors the total number of remote connections from TCP/IP requesters, including the current active connections and the inactive connections. Active connections are either currently associated with an active database access thread or have been queued and are waiting to be serviced. Inactive connections are currently not waiting and not associated with a database access thread.

      This monitoring function is subject only to filtering by the LOCATION column in the SYSIBM. DSN_PROFILE_TABLE. However, you can specify either an IP address or a domain name for the value the LOCATION column.

      The system-wide threshold that is defined by the value of the CONDBAT subsystem parameter continues to apply. Because the threshold specified by the subsystem parameter would always apply first, Db2 rejects any profile that specifies a threshold for the MONITOR CONNECTIONS keyword that is higher than the value of the CONDBAT subsystem parameter.

    3. Insert values in the ATTRIBUTE1 column of DSN_PROFILE_ATTRIBUTES table to specify how Db2 responds when a threshold is met.
      The possible values in the ATTRIBUTE1 column has two parts:
      • The first part is the type of monitoring:
        WARNING
        A console message is issued at most every 5 minutes depending on the specified diagnosis level. When WARNING is specified, WARNING_DIAGLEVEL1 is used.
        EXCEPTION
        Db2 issues the messages that are specified by the diagnosis level and rejects any new incoming remote connection requests.
      • The second part of the value in the ATTRIBUTE1 column controls the amount of detail in the message that Db2 issues when the threshold is met:
        type_DIAGLEVEL1
        Where type is WARNING or EXCEPTION, Db2 takes the appropriate specified action and issues a DSNT771I console message, which contains minimal information.
        type_DIAGLEVEL2
        Where type is WARNING or EXCEPTION, Db2 takes the specified action. Db2 also issues a DSNT772I console message, which contains additional information such as the profile ID and reason code in the message text.
        Start of changetype_DIAGLEVEL3End of change
        Start of changeWhere type is WARNING or EXCEPTION, Db2 takes the specified action.

        If type is WARNING, Db2 also issues a DSNT773I console message, which contains detailed information that you can use to identify the thread that exceeded the warning value.

        If type is EXCEPTION, Db2 also issues a DSNT774I console message, which contains detailed information that you can use to identify the thread that exceeded the exception value.

        End of change
    4. Insert values in the ATTRIBUTE2 column of DSN_PROFILE_ATTRIBUTES table to specify the threshold that the monitor uses.

    The following table summarizes the meanings of the different columns of the DSN_PROFILE_ATTRIBUTES table for the MONITOR CONNECTIONS .

    Table 1. Summary of DSN_PROFILE_ATTRIBUTES values for monitoring threads and connections
    KEYWORD ATTRIBUTE1 column ATTRIBUTE2 column ATTRIBUTE3 column
    MONITOR CONNECTIONS Specify one of the following types of monitoring:
    • WARNING
    • WARNING_DIAGLEVEL1
    • WARNING_DIAGLEVEL2
    • Start of changeWARNING_DIAGLEVEL3End of change
    • EXCEPTION
    • EXCEPTION_DIAGLEVEL1
    • EXCEPTION_DIAGLEVEL2
    • Start of changeEXCEPTION_DIAGLEVEL3End of change
    Insert a value to indicate the threshold for the maximum allowed number of remote connections that meet the profile criteria.

    The value that you specify must be less than or equal to the value of the CONDBAT subsystem parameter.

    Not used.
  3. Issue the START PROFILE command to start the monitoring functions that are specified in the profile tables.