Oracle® Enterprise Manager

System Monitoring Plug-in Installation Guide for IBM DB2 Database

Release 12.1.0.3.0

E25215-05

October 2014

This document provides a description about the Oracle System Monitoring Plug-In for IBM DB2 Database, details on the versions the plug-in supports, prerequisites for installing the plug-in, and step-by-step instructions on how to download, install, verify, and validate the plug-in.

1 Description

The System Monitoring Plug-in for IBM DB2 Database extends Oracle Enterprise Manager Cloud Control to add support for managing IBM DB2 Universal Database (UDB) for Linux, UNIX, and Windows (LUW) database instances. By deploying the plug-in in your Cloud Control environment, you gain the following management features:

Raise alerts and violations based on thresholds set on monitored targets and configuration data.

Provide rich, out-of-box reports based on the gathered data.

Support monitoring by a remote Agent. Local Agent is an agent running on the same host as the DB2 database. Remote Agent is an agent running on a host that is different from the host where DB2 database is running.

Collect and display top SQL statements and their related statistics, including CPU Time and Execution Count, of your IBM DB2 Database.

Collect and display information regarding the top Lock Wait Events in IBM DB2, including top Wait Count by Table and top Wait Times.

Utilization of Cloud Control jobs to start and stop the IBM DB2 database. These jobs are not only accessible from the Cloud Control Jobs Library but also from the IBM DB2 plug-in's UI home page.

Expose vital IBM DB2 Database metrics in the form of easy-to-use charts and tables.

2 What's New in This Release

This release of the IBM DB2 Database plug-in for Oracle Enterprise Cloud Control 12c includes many new features for better visibility into your IBM DB2 environment. Highlighted below are some of the new features included in this release.

Currency Support Updates

The IBM DB2 Database plug-in for Oracle Enterprise Manager Cloud Control 12c has been updated to be current with the latest release of IBM DB2 Databases. This includes the added support for IBM DB2 9.7, 10.0, and 10.5.

IBM DB2's High Availability Disaster Recovery (HADR) functionality allows for currency support with the addition of monitoring metrics.

Updated User Interface

The user interface has been updated to add an Analysis page and add new content to the Home page.

The home page (Figure 1) has been enhanced to prioritize quicker trouble detection and resolution through IBM DB2 summary metrics. It has also been updated to expose additional performance and health metrics, such as: job summary, incidents, database health indicators and more.

Figure 1 IBM DB2 Database Plug-in Home Page

The all-new Analysis page (Figure 2) has been added to the plug-in to give greater insight into the monitored IBM DB2's SQL Statistics, Lock Waits, Application Waits and more.

Figure 2 IBM DB2 Database Plug-in Analysis Page

IBM DB2 Top SQL Queries

This release adds the ability to monitor and return metrics on the top SQL queries from your IBM DB2 Database. This includes metrics for CPU Time and Execution Count of the query as well as the query itself.

The Top SQL Statements (Figure 3) can be adjusted to view the top queries by day, week, or month.

Figure 3 IBM DB2 Database Plug-in Top SQL Statements

IBM DB2 Top Lock Waits

Also added to the Analysis page is the metrics for the monitoring of IBM DB2 Lock Wait Events. This table (Figure 4) shows the top lock wait events in IBM DB2 and can be organized by blocking application, blocked application, table, or all waits.

Figure 4 IBM DB2 Database Plug-in Lock Wait Events

Additional Jobs

All new to this release are the Stop, Start, Quiesce, Unquiesce, and Kill Application jobs. These jobs can be accessed from the Cloud Control Jobs Library, or directly from the user interface of the plug-in.

If you want to generate alerts using the IBM DB2 Diagnostic Log file (db2diag.log), then do the following:

Define your match patterns in the Diag_log_file_match_pattern_file.txt file that is present in $ORACLE_HOME/plugins/oracle.em.sidb/scripts/emx/ibm_db2_database/.

Define your ignore patterns in the Diag_log_file_no_match_pattern_file.txt file that is present in $ORACLE_HOME/plugins/oracle.em.sidb/scripts/emx/ibm_db2_database/.

Set the DIAG_PATH configuration parameter of the database manager (instance) to correspond to the monitored IBM DB2 database.

Based on the patterns defined in the two files, the System Monitoring Plug-in for IBM DB2 parses the Diagnostic Log file and generates alerts for the satisfied conditions. First, the plug-in validates the two files to see if any patterns are defined. If no patterns are defined, then the plug-in does not parse the Diagnostic Log file. If matching patterns are not defined, but ignore patterns are defined, then the plug-in parses every entry in the Diagnostic Log file and checks if ignore patterns are satisfied. If matching patterns are also defined, then the plug-in first parses only those entries that satisfy the matching patterns, and then for those satisfied entries, the plug-in checks if ignore patterns are satisfied.

Also, if multiple log entries having the same function name are encountered in a collection, then only one alert is generated to represent the function name. This alert is based on the last log entry with a common function name, present in the Diagnostic Log file.

Note:

This feature is supported only for local monitoring, that is, when the IBM DB2 database on a host is monitored by an Oracle Management Agent that is running on the same host.

In the IBM DB2 Database SQL Statement Performance and IBM DB2 Database Applications Lock Performance reports and the Agent Monitoring metric, in order to see the SQL statement text along with the application name, enable the instance configuration parameter DFT_MON_STMT. Otherwise, you may not see any data in the column.

As part of JDBC URL, either IP Address or host name can be provided. Ensure that the host name can be resolved consistently on the network. Standard TCP tools such as "nslookup" and "traceroute" can be used to verify the host name. Validate using the following commands on Management Agent where plug-in is deployed:

nslookup <hostname>

This returns the IP address and fully qualified host name.

nslookup <IP>

This returns the IP address and fully qualified host name.

6 Setting Up the JDBC Driver

The JDBC driver is available from IBM, and consists of the following files that the Agent must be able to access:

db2jcc.jar

db2jcc_license_cu.jar

To set up the AGENT_BASE_DIR directory for the IBM DB2 Universal Type 4 JDBC driver:

If it does not already exist, create the directory $AGENT_BASE_DIR/plugins/dependencies/oracle.em.sidb/jdbcdriver/.

Copy the three JDBC driver files into the directory $AGENT_BASE_DIR/plugins/dependencies/oracle.em.sidb/jdbcdriver/.

Note:

If you do not have access to or cannot find your db2jcc.jar driver, you can download a copy of it from IBM's support site:

7 Configure the Management Agent to Deploy the Plug-In

To configure the Agent, you must first ensure that the user starting the Agent service belongs to the Local Administrators Group. Also, you must set the preferred credentials on all Agents where you want to deploy the plug-in. To do so, follow the instructions given in the following sections.

7.1 Assigning Advanced Privileges to User

To assign advanced privileges, do the following:

Locally on the Microsoft Windows node hosting the Agent, check that the user starting the Agent service belongs to the Local Administrators Group. If not, add it.

Open the Local Security Settings Windows Tool and give the following Advanced Privileges to the user starting the Agent service:

Select Host target type from the table and then click Managed Preferred Credentials.

The Host Preferred Credentials page appears.

In the Host Preferred Credentials page, in the Target Credentials section, select the host that is running the Management Agent where the plug-in has to be deployed, and click Set.

In the Select Named Credential dialog box, Select Credential as New and specify the user name and password and click Test and Save. If your test runs successfully, your credentials are set correctly.

Run the OS Command job for the Management Agent where the plug-in has to be deployed.

Log in to Enterprise Manager Cloud Control.

From the Enterprise menu, select Job and then Activity.

In the Job Activity page, from the Create Job list, select OS Command, and click Go.

Fill up the details required in the following pages, and click Submit to run the job. If the job runs successfully, your credentials are set correctly.

8 Using a Suitable Operating System User and Assigning Authorities and Privileges

The System Monitoring Plug-In for IBM DB2 accesses the table functions used in IBM DB2. For the plug-in to have access to the table functions, you have to use a suitable operating system user and assign this new user to a user group. The operating system user must have at least the minimum privileges. In addition, you have to assign the correct authority levels to this user.

Note:

IBM DB2 users must be operating system users. IBM DB2 cannot have its own database users because it relies on the host operating system for security.

If you do not have an operating system user already created, first, create one on the host where IBM DB2 is running. Then, follow these steps to assign this user to a new or existing UserGroup.

Open the IBM Data Studio.

From the tree view, select the database that you wish to modify, and connect using an admin account as shown in Figure 5:

Figure 5 Connect to IBM Data Studio

From the tree view, expand Users and Groups and select Users.

From the right pane, select Create a New Object.

In the General tab of the Properties window for the New User, enter the operating system username.

From the Privileges tab, verify that the account is granted CONNECT.

To verify the applied changes, try connecting to the database with the newly created user as shown in Figure 6:

Figure 6 Connect to Database

Note:

These steps can also be performed from the command line using IBM DB2 SQL.

Also, assign authorities and privileges for the operating system UserGroup. The authorities supported with IBM DB2 are SYSADM, SYSCTRL, SYSMAINT, DBADM, and LOAD. The SYSADM, SYSCTRL, and SYSMAINT authorities cannot be granted using the GRANT SQL statement. These special authorities can only be set from the database manager configuration file. DBADM privilege can only be granted by user at SYSADM authorization level.

SYSMON authority level is required to monitor IBM DB2. This level is required to access the table functions, such as SYSPROC.SNAPSHOT_DATABASE, which are used in IBM DB2.

10.1 Configurations Required for Health Indicator Metrics

The health indicators for instance and database objects are enabled and disabled using the database manager configuration parameter -- HEALTH_MON. Then, the table functions -- HEALTH_TBS_HI, HEALTH_DB_HI, and HEALTH_DBM_HI get populated. These functions are used by the plug-in to show the alerts triggered based on the thresholds of health indicators.

Note:

Enabling these settings may result in some overheads, such as CPU and memory. Therefore, follow these steps only if you want to view the Health Indicator metrics.

To enable or disable the HEALTH_MON by CLP (Command Line Processor), run the following command:

To avoid metric collection errors for the "Database Monitoring" metrics, make a call to the GET_DBSIZE_INFO package so that the STMG_DBSIZE_INFO table gets created and populated with the required data.

The GET_DBSIZE_INFO procedure calculates the database size and maximum capacity. The calculated values are returned as procedure output parameters and cached in the SYSTOOLS.STMG_DBSIZE_INFO table. The procedure caches these values because the calculations are costly.

The SYSTOOLS.STMG_DBSIZE_INFO table is created automatically the first time the procedure runs. If there are values cached in the SYSTOOLS.STMG_DBSIZE_INFO table and they are current enough, as determined by the snapshot-timestamp and refresh-window values, then these cached values are returned.

If the cached values are not current enough, new cached values are calculated, inserted into the SYSTOOLS.STMG_DBSIZE_INFO table and returned, and the snapshot-timestamp value is updated. The last parameter in the GET_DBSIZE_INFO call is refresh window.

Default value refresh window (time difference between successive calls) is 30 minutes. If your database is growing at a faster rate, then you can set a lower value.

To make a call to GET_DBSIZE_INFO by CLP (Command Line Processor), run the following command:

10.3 Configurations Required for Statement Monitoring

To avoid metric collection errors for the statement monitoring metrics, run the following command at the DB2 prompt to update the database manager configuration so the switch for monitoring statements is on:

db2 => update dbm cfg using DFT_MON_STMT on

10.4 Configurations Required for Lock and Lock Waits Monitoring

To avoid metric collection errors for the lock and lock waits information in the analysis page, run the following command at the DB2 prompt to set up permissions so the monitoring plug-in user can query the lock waits administrative view in DB2.

For IBM DB2 Versions 9.1 and 9.5, update the database manager configuration so the switch for locks and lock waits is on:

db2 => update dvm cfg using DFT_MON_LOCK on

For IBM DB2 Versions 9.7 and above, ensure that the DB2 user has select permission on MON_LOCKWAITS administrative view, and has DATAACCESS authority. Run the following commands where '[username]' is the monitoring username used when configuring the target:

JDBC Driver: (Optional) Name of the DB2 Universal JDBC Driver. For example:

com.ibm.db2.jcc.DB2Driver

JDBC URL: URL name for the IBM DB2 JDBC Driver connectivity. For example:

jdbc:db2://<server>:<port>/<database>

The JDBC URL argument represents a data source. Parameter definitions are as follows:

Table 1 JDBC URL Parameter Definitions

JDBC URL Parameter

Definition

jdbc:db2

Indicates that the connection is to a DB2 UDB server.

server

Fully qualified hostname or IP address of the database server.

port

TCP/IP server port number assigned to the database server, which is an integer between 0 and 65535. The default port for IBM DB2 Database is 50000.

database

Database alias, which refers to the DB2 database catalog entry on the DB2 client.

The database argument is the database name defined during DB2 UDB (LUW) installation.

Figure 7 Add IBM DB2 Database Page

Click Test Connection to make sure the parameters you entered are correct.

Note:

After you deploy and configure the plug-in to monitor one or more targets in the environment, you can customize the monitoring settings of the plug-in. This alters the collection intervals and threshold settings of the metrics to meet the particular needs of your environment. If you decide to disable one or more metric collections, this could impact the reports that the metric is a part of.

12 Verifying and Validating the Plug-in

After waiting a few minutes for the plug-in to start collecting data, follow these steps to verify and validate that Enterprise Manager is properly monitoring the plug-in target:

Verify that no metric collection errors are reported by clicking Monitoring and then Metric Collection Errors from the Target menu.

Ensure that reports can be seen and no errors are reported by clicking Information Publisher Reports in the Target menu and viewing reports for the IBM DB2 Database target type.

Ensure that configuration data can be seen by clicking Configuration and then Last Collected in the Target menu. If configuration data does not immediately appear, click Refresh in the Latest Configuration page.

Ensure that the Analysis page can be viewed by clicking Analysis in the Target menu. The IBM DB2 Database Analysis page appears as shown in Figure 9:

Figure 9 IBM DB2 Database Plug-in Analysis Page

13 Creating and Editing Jobs

To create and edit jobs, follow these steps:

In Enterprise Manager Cloud Control 12c, click Enterprise, then Job, then click Activity.

On the Job Activity page, select a job type from the Create Job menu and click Go.

Select one of the following jobs:

Shutdown IBM DB2: Performs a Shutdown of the IBM DB2 Database Instance. When the IBM DB2 Database Instance is started, the Shutdown job icon will be accessible in the Summary section of the Target Home page.

Startup IBM DB2: Performs a Startup of the IBM DB2 Database Instance. When the IBM DB2 Database Instance is shut down, the Startup job icon will be accessible in the Summary section of the Target Home page.

(Select this option when you want to remove the DB2 database from maintenance mode.)

Kill DB2 Application: Forcibly end an agent's session in DB2 to kill an application. This job is also accessible from the Analysis page as the Kill Application button when an Application when viewing Lock Wait By Blocking Application and an application is selected.

(Select this option to end an application by specifying the agent id in the Parameters tab when creating the job.)

Note:

All jobs available for the IBM DB2 Database plug-in are only available when the plug-in is set up for local monitoring of the database.

In the General tab of the Create <Job Type> Job page, provide a name for the job and add the individual targets or one composite target such as a Group. If you are editing a job, then modify the job name and the selected targets.

Note:

These jobs do not require and parameters to be set in the Parameters tab of the Create <Job Type> Job page.

In the Credentials tab of the Create <Job Type> Job page, select an appropriate option for credentials.

You can choose to use the preferred credentials that are already set or override the preferred credentials with new credentials. In either case, you need to provide the credentials for agent host and database host.

To set the preferred credentials, click Preferences at the top-right corner of the Cloud Control console. From the left-vertical navigation bar, click Preferred Credentials. Cloud Control displays the Preferred Credentials page. On this page, you can set the preferred credentials.

In the Schedule tab of the Create <Job Type> Job page, schedule the job.

In the Access tab of the Create <Job Type> Job page, define or modify the access you want other users to have to this job.

Click Submit to create the job.

Note:

To enable use of the Job Buttons found in the Summary section of the Target home page, be sure to set the Preferred Credentials for the IBM DB2 Database target type.

14 Using the IBM DB2 Database Plug-in Reports

To further aid administrators with critical tasks such as problem diagnosis, trend analysis and capacity planning, the IBM DB2 Database plug-in includes twenty-eight out-of-box reports.

Figure 10 IBM DB2 Database Plug-in Reports

To generate a new report from one of the out-of-the-box reports provided by Oracle, follow these steps:

From the Enterprise Manager Cloud Control web console, click the Enterprise menu and select Reports, then Information Publisher Reports as shown in Figure 11:

Figure 11 Information Publisher Reports Menu Item

Choose IBM DB2 Database from the Target Type list inside the Search menu and then click Go as shown in Figure 12:

Figure 12 Search for Target Type

After the reports have been sorted to IBM DB2 Database reports only, find the desired report and click on the report title hyperlink.

In the Specify Target for Report page, click the magnify glass to find the specific IBM DB2 Database target you wish to create a report for.

After selecting the target, click Continue to finish generating the report.

Table 2 shows the Information Publisher Reports that are provided by Oracle:

This software and related documentation are provided under a license agreement containing restrictions on use and disclosure and are protected by intellectual property laws. Except as expressly permitted in your license agreement or allowed by law, you may not use, copy, reproduce, translate, broadcast, modify, license, transmit, distribute, exhibit, perform, publish, or display any part, in any form, or by any means. Reverse engineering, disassembly, or decompilation of this software, unless required by law for interoperability, is prohibited.

The information contained herein is subject to change without notice and is not warranted to be error-free. If you find any errors, please report them to us in writing.

If this is software or related documentation that is delivered to the U.S. Government or anyone licensing it on behalf of the U.S. Government, the following notice is applicable:

U.S. GOVERNMENT RIGHTS Programs, software, databases, and related documentation and technical data delivered to U.S. Government customers are "commercial computer software" or "commercial technical data" pursuant to the applicable Federal Acquisition Regulation and agency-specific supplemental regulations. As such, the use, duplication, disclosure, modification, and adaptation shall be subject to the restrictions and license terms set forth in the applicable Government contract, and, to the extent applicable by the terms of the Government contract, the additional rights set forth in FAR 52.227-19, Commercial Computer Software License (December 2007). Oracle USA, Inc., 500 Oracle Parkway, Redwood City, CA 94065.

This software or hardware is developed for general use in a variety of information management applications. It is not developed or intended for use in any inherently dangerous applications, including applications that may create a risk of personal injury. If you use this software or hardware in dangerous applications, then you shall be responsible to take all appropriate fail-safe, backup, redundancy, and other measures to ensure its safe use. Oracle Corporation and its affiliates disclaim any liability for any damages caused by use of this software or hardware in dangerous applications.

Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

This software and documentation may provide access to or information on content, products, and services from third parties. Oracle Corporation and its affiliates are not responsible for and expressly disclaim all warranties of any kind with respect to third-party content, products, and services. Oracle Corporation and its affiliates will not be responsible for any loss, costs, or damages incurred due to your access to or use of third-party content, products, or services.

Scripting on this page enhances content navigation, but does not change the content in any way.