Configure Connection
IBM DB2 guide
Install the IBM Db2 ODBC driver, prepare an account with database access, and configure and test the connection in NIM.
Before you startDirect link to Before you start
Install the IBM ODBC driver on the NIM server and arrange an account that your Db2 environment can authenticate. The operating system account examples below apply to deployments using OS-based authentication; use your organization's identity source if Db2 authenticates through another provider.
NIM requires Driver name, Hostname, Port, Database, Schema, Username, and Password. A default driver name is provided in the connector.
Install and register the driverDirect link to Install and register the driver
-
Download the IBM Db2 ODBC/CLI driver for the architecture used by the NIM connector.
-
Create
C:\Program Files\IBMon the NIM server. -
Extract the contents of clidriver into that folder.
-
Open Command Prompt as administrator and run these commands separately:
cd /d "C:\Program Files\IBM\bin"db2cli install -setupIf your extraction retains a
clidriversubfolder, use that folder'sbindirectory instead. -
Confirm that the driver is registered in ODBC Data Source Administrator > Drivers.
Create an account for database accessDirect link to Create an account for database access
Create the account in the identity source used by the Db2 server, rather than assuming that a local account on the NIM server will be accepted.
Linux / UNIXDirect link to Linux / UNIX
-
Sign in with root or sudo privileges on the host providing OS authentication for Db2.
-
Confirm the appropriate Db2 user group with your administrator. The following Linux example assumes that
db2usersalready exists:sudo useradd -m -g db2users new_db2usersudo passwd new_db2userReplace the group and username as needed. On other UNIX platforms, use the equivalent account creation tools.
WindowsDirect link to Windows
- On the Windows host providing OS authentication, open Computer Management (
compmgmt.msc) and go to System Tools > Local Users and Groups > Users. - Right-click Users, select New User, enter the account details, and set a password.
- Open the new user's Properties > Member Of and add the account to DB2USERS when that group is used by your installation. Db2 installations can use a different configured group name.
Grant database permissionsDirect link to Grant database permissions
Have the Db2 administrator grant CONNECT access to the intended database and SELECT access to the tables or views NIM will collect. Operating system group membership alone does not grant these database privileges. Authorize any intended writes separately.
See IBM's authentication overview, Windows security group guidance, and Db2 security model.
Enter the connection settingsDirect link to Enter the connection settings
- In NIM Studio, open Systems > Overview and add an IBM DB2 system, or select the existing system.
- Open its Connection screen.
- Enter the following settings and save the connection.
| NIM setting | Value |
|---|---|
| Driver name | The registered IBM Db2 ODBC driver name. Retain the connector default if it matches the installed driver. |
| Hostname | The Db2 server hostname. |
| Port | The connection port supplied by the Db2 administrator. |
| Database | The database NIM will connect to. |
| Schema | The schema containing the tables or views to collect. |
| Username | The account authorized to connect to the database. |
| Password | The password belonging to that account. |
Test the database connectionDirect link to Test the database connection
- Select Test Connection. NIM attempts to open a connection to the configured Db2 database.
- Confirm that the connection opens successfully. If it fails, check the driver registration and architecture, hostname, port, database, credentials, and network access.
- Collect the system and inspect the expected tables and records in the configured schema.
- If connection succeeds but collection fails, verify the schema and the account's table or view permissions.
- Validate the collected records and matching rules before using Db2 as source or supplemental data for automation.
A successful connection test does not confirm access to every table. Validate collection and any intended write operations separately.