IBM DB2 — Prerequisites
Prerequisites for monitoring IBM DB2 with HEAL.
Prerequisites to complete before adding this component in the HEAL Control Center.
Only the users that are part of the SYSMON database manager level group have the authority to gain access to database system monitor data. Make sure that you create a DB2 user with SYSMON authorization. After creating the user, you may log on to DB2 as the user to check for the user authorization. One way is to execute a privileged command.
For example, execute the following command in the DB2 console:
SELECT * FROM SYSIBMADM.SNAPAPPL
If the above command returns a valid result-set, it means that the user has all necessary authorization required for monitoring DB2.
Creating a DB2 User in Linux#
To create a DB2 user, you should have user and group setup. Refer to the section below for more information.
There are three ways to create a DB2 User:
- DB2 Launchpad: During DB2 Launchpad installation, the default users and groups are created. It also provides you an option to specify your own user and group name.
-
Response File: During response file installation, the DB2 users are created if you specify user and group information in the response file. For example, consider the following entries in a response file that creates the three required users and groups for DB2:
* DAS user DAS_USERNAME = dasusr1 DAS_GROUP_NAME = dasadm1 DAS_HOME_DIRECTORY = /home/dasusr1 DAS_PASSWORD = ****** *Instance-owning user inst1.NAME = db2inst1 inst1.GROUP_NAME = db2grp1 inst1.HOME_DIRECTORY = /db2home/db2inst1 inst1.PASSWORD = ****** inst1.AUTOSTART = YES inst1.AUTHENTICATION = SERVER inst1.SVCENAME = db2c_db2inst1 inst1.PORT_NUMBER = 50001 inst1.FCM_PORT_NUMBER = 60000 inst1.MAX_LOGICAL_NODES = 4 *Fenced user inst1.FENCED_USERNAME = db2fenc1 inst1.FENCED_GROUP_NAME = db2fgrp1 inst1.FENCED_HOME_DIRECTORY = /db2home/db2fenc1 inst1.FENCED_PASSWORD = ****** -
Manually using the command line:
- Log on to your system as a root user.
-
Create groups for an instance owner, for the fenced user, and for the DAS user by using the following commands:
groupadd db2grp1Note: Groups are created based on the first available Group ID (GID) numbers. You can also specify GID numbers of your own.
-
Create a user in a group and specify the DB2 home directory. For example, you can place all home directories in
/db2homeby using the following commands:useradd -g db2grp1 -m -d /db2home/db2inst1 db2inst1 -p password1The DB2 user has been created successfully in Linux.
Creating a DB2 User in Windows#
Follow the below steps to create a DB2 user in Windows:
- Click Start icon on your desktop.
- Enter
mmcin the search text box. - Press Enter. The Microsoft Management Console screen is displayed.Note: To access Microsoft Management Console (MMC), administrator permission is required which prompts you to provide an administrator password or confirmation.
-
Click Local Users and Groups in the left pane of the Microsoft Management Console screen. The Users and Groups folders are displayed.Note: In case Local Users and Groups is not displayed in the left pane of Microsoft Management Console, follow these steps to install the same:
- Click File menu in the Microsoft Management Console screen. A list of menu items is displayed.
- Click Add/Remove Snap-in. The Add or Remove Snap-ins screen is displayed.
- Select Local Users and Groups and click Add. The Choose Target Machine screen is displayed.
- Select Local Computer using the radio button and click Finish.
- Click Ok.
Now, the Local Users and Groups are displayed in the Microsoft Management Console.
-
Double-click the Groups folder. A list of group names is displayed.
- Click Actions → More Actions → New Group. The New Group screen is displayed.
- Enter the Group name and Description.
- Click Add. The Select Users, Computers, Service Accounts, or Groups screen is displayed.
- Enter the name of the user account and click Check Names.
- Click Ok.
- Click Ok.
- Click Create.
DB2 user is successfully created in Windows.
User and Group Setup#
DB2 requires user IDs and groups for database authentication. It requires a minimum of three users and groups, i.e. an instance owner, a fenced user, and the Database Administration Server (DAS) user. You may use the default names provided by the setup utilities or specify your own user and group names. For example, consider the following default user IDs and group names produced by the DB2 Setup Launchpad:
| Required User | User name | Group name | Description |
|---|---|---|---|
| Instance Owner | db2inst1 | db2grp1 | Administers a DB2 instance. |
| Fenced user | db2fenc1 | db2fgrp1 | Responsible for executing “fenced” user-defined functions, such as JDFs and stored procedures. |
| DAS user | dasusr1 | dasadm1 | Administers the DB2 Administration Server. |
- Gather DB2 user credentials. You need these details to add DB2 as a component in the HEAL dashboard and to execute certain commands to enable SQL KPI monitoring on DB2.
- Enable the required monitor switches in the DB2 server.
To enable monitor switches on DB2, follow the below steps:
- Log on to the DB2 server computer as a valid DB2 user.Note: If you are not able to execute commands, make sure that the DB2 user meets the SYSMON authorization requirements mentioned in the DB2 prerequisites section.
-
Enable the Update Monitor switch by using the following command:
db2 UPDATE MONITOR SWITCHES USING STATEMENT ON -
Enable the default monitor switch by using the following command:
db2 UPDATE DBM CFG USING DFT_MON_STMT ON -
Stop and restart the DB2 server by using the following commands:
db2stop db2start
See also: IBM DB2 (what HEAL monitors) · Setup & configuration guide