Download PDF
Download page Configure IBM DB2 Collectors.
Configure IBM DB2 Collectors
This page describes configuration details for IBM DB2 collectors.
Prerequisites
To monitor IBM DB2 with Database Visibility, you must be running DB2 >= 9.x.
Connection Details
Section | Field | Description |
---|---|---|
Create New Collector | Database Type | The database type that you want to monitor. |
Agent | The Database Agent that manages the collector. | |
Collector Name | The name you want to identify the collector by. | |
Connection Details | Hostname or IP Address | The hostname or IP address of the machine that your database is running on. |
Database | The name of the database instance that you want to monitor. If the database instance hosts multiple databases, ensure to create separate collector for each database. | |
Listener Port | The TCP/IP address of the port on which your database communicates with the Database Agent. | |
Custom JDBC Connection String | The JDBC connection string generated by the database agent, for example, If you are using the connection string for Kerberos authentication, ensure to select the Kerberos option under Advanced Options. | |
Username and Password | Username | The name of the user who is connecting to and monitoring the database through the Database Agent. The user should have the permissions described in User Permissions for IBM DB2 LUW. |
Password | The password of the user who is connecting to and monitoring the database through the Database Agent. | |
Cyberark | Click to enable CyberArk for database username and password. When CyberArk is enabled, information about Application, Safe, Folder, and Object is required to fetch the username and password for your database. To use CyberArk with Database Visibility, you must download the JavaPasswordSDK.jar file from the CyberArk web site and rename the file to cyberark-sdk-9.5.jar . Then, you must copy the JAR file to the lib directory of the database agent zip file. | |
Advanced Options | Sub-Collectors | Click to monitor multiple database instances in a consolidated view, and aggregate metrics of multiple databases. To monitor a custom cluster, you can add additional hostname or IP address, and port details for each sub-collector. You can add up to a total of 29 sub-collectors. Thereby, 30 databases can be monitored in a custom cluster. In addition to the licenses consumed by the main collector, each sub-collector consumes one or more licenses, depending on the database type. Note
|
Connection Properties | Click to add a new JDBC connection property or edit an existing property for relational databases. For monitoring the database using Kerberos authentication, follow the instructions mentioned at Monitor IBM DB2 Databases Using Kerberos Authentication. | |
Kerberos | Click to use Kerberos authentication to manage the database user and host user passwords. | |
Monitor Operating System | See Configure the Database Agent to Monitor Server Hardware. |
User Permissions for IBM DB2 LUW
The monitoring user needs SYSMON authority and connection privileges to monitor. This user must be a part of the sysmon_group.
To generate an execution plan, you must create the associated EXPLAIN tables in the schema.
DB2 >= 9.7
For complete Database Visibility functionality, the following monitoring switches of the DB2 server need to be enabled: "TIMESTAMP".
To enable the "TIMESTAMP" monitoring switch, enter:
update dbm cfg using dft_mon_timestamp on;
update db cfg using mon_act_metrics BASE
Privileges
grant select on SYSIBMADM.MON_CURRENT_SQL to user DBMon_Agent_User
grant select on SYSIBMADM.MON_LOCKWAITS to user DBMon_Agent_User
grant execute on function SYSPROC.MON_GET_CONNECTION to user DBMon_Agent_User
grant execute on function SYSPROC.MON_GET_PKG_CACHE_STMT to user DBMon_Agent_User
(version 10.5 and above) grant execute on function SYSPROC.MON_GET_TRANSACTION_LOG to DBMon_Agent_User
(version 10.5 and above) grant execute on function SYSPROC.MON_GET_DATABASE to DBMon_Agent_User
Replace DBMon_Agent_User
with the user name under which you run the Database Visibility Agent.
DB2 9.5
For complete Database Visibility functionality, the following monitoring switches of the DB2 server need to be enabled: "STATEMENT", and "TIMESTAMP".
To enable these monitoring switches, enter:
update dbm cfg using dft_mon_stmt on;
update dbm cfg using dft_mon_timestamp on;
Privileges
grant select on SYSIBMADM.SNAPSTMT to user DBMon_Agent_User
grant select on SYSIBMADM.SNAPAPPL_INFO to user DBMon_Agent_User
grant select on table SYSIBMADM.ENV_PROD_INFO to user DBMon_Agent_User
where DBMon_Agent_User
is the user name under which you run the Database Visibility Agent.
User Permissions When restrict_access is Set to YES
If your database has the restrict_access
parameter set to YES, you must grant these privileges:
grant select on SYSIBMADM.MON_CURRENT_SQL to user DBMon_Agent_User;
grant select on SYSIBMADM.MON_LOCKWAITS to user DBMon_Agent_User;
grant execute on function SYSPROC.MON_GET_CONNECTION to user DBMon_Agent_User;
grant select on SYSIBMADM.SNAPAPPL_INFO to user DBMon_Agent_User;
grant EXECUTE on function SYSPROC.MON_GET_PKG_CACHE_STMT to user DBMon_Agent_User;
grant execute on function SYSPROC.MON_GET_TRANSACTION_LOG to user DBMon_Agent_User;
grant EXECUTE on package NULLID.SQLC2K26 to user DBMon_Agent_User;
grant select on SYSIBM.SYSDUMMY1 to user DBMon_Agent_User;
grant select on SYSIBMADM.ENV_PROD_INFO to user DBMon_Agent_User;
grant select on SYSIBMADM.ENV_SYS_RESOURCES to user DBMon_Agent_User;
grant execute on function SYSPROC.SNAP_GET_STMT(varchar(),Integer) to user DBMon_Agent_User;
grant select on SYSCAT.STATEMENTS to user DBMon_Agent_User;
grant select on SYSIBMADM.DBCFG to user DBMon_Agent_User;
grant execute on function SYSPROC.SNAP_GET_DB(varchar(),Integer) to user DBMon_Agent_User;
grant EXECUTE on package NULLID.SYSSH200 to user DBMon_Agent_User;
grant select on SYSIBMADM.ENV_SYS_RESOURCESto user DBMon_Agent_User;
grant select on SYSCAT.DBAUTH to user DBMon_Agent_User;
grant execute on function SYSPROC.SNAP_GET_DBM(Integer) to user DBMon_Agent_User;
grant select on syscat.schemata to user DBMon_Agent_User;
Replace DBMon_Agent_User
with the user name under which you run the Database Visibility Agent.
Generate Execution Plans
To generate an execution plan in DB2, the monitoring user ID must have access to the explain_* tables.
- Create the explain tables one of theses methods:
- Call the
SYSPROC.SYSINSTALLOBJECTS procedure:{{}}
- Call the
{{db2 CONNECT TO database-name
db2 }}
{{CALL SYSPROC.SYSINSTALLOBJECTS('EXPLAIN', 'C',
CAST (NULL AS VARCHAR(128)), CAST (NULL AS VARCHAR(128)))}}
This call creates the explain tables under SYSTOOLS schema. To create them under a different schema, specify a schema name as the last parameter in the call.
- Run the
EXPLAIN.DDL command file:{{}}
- Run the
{{db2 CONNECT TO database-name
db2 -tf EXPLAIN.DDL}}
{{}}
Explain plans will not function properly unless the monitoring user ID is granted SELECT privilege on every table being accessed in the SQL as well as the necessary explain_* tables.