IBM i DB2 drivers
Drivers for IBM i DB2
Applications using an IBM i DB2 database require drivers. Depending on your requirements, you can either use the DB2 .NET Core drivers or the IBM .NET Data Provider drivers.
We recommend using the newer .NET Core drivers due to vast performance improvements.
Use DB2 .NET Core drivers
Indicium can use the DB2 .NET Core drivers, which do not require installation. This makes it possible to run Indicium on platforms other than Windows, and to deploy Indicium in managed cloud services, such as Azure Web Apps and AWS Elastic Beanstalk.
- IBM requires IBM i and z/OS customers to have a valid DB2 Connect license to use these drivers. For more information, contact IBM Customer Support.
- Using DB2 with any of the reporting types mentioned in the .NET Framework section currently requires the old iSeries DB2 driver to be installed.
To deploy Indicium with the DB2 .NET Core drivers:
- Download the IBM.Data.DB2.Core driver from TCP - Thinkwise products.
- Extract the
clidriverfolder to the root the Indicium installation directory. - Place a valid DB2 Connect license file (
db2consv_*.lic) in the<Indicium installation path>\clidriver\licensefolder.
See also Troubleshooting DB2 .NET Core drivers.
Use IBM .NET Data Provider drivers
The IBM .NET Data Provider drivers are part of the IBM i Access Client Solutions - Windows Application Package. If you choose to use the IBM .NET Data Provider drivers, they must be installed separately on the client or server running the application. Make sure you install the latest version.
To install the IBM .NET Data Provider, and optionally the ODBC driver:
- Download the IBM i Access Client Solutions - Windows Application Package here: ACS Windows App Pkg English (64bit) (login required).
- Install the .NET Data Provider driver.
- Optionally, install the ODBC driver.
Installing the IBM i Access .NET Data Provider
Ports
The database provider uses various network ports to connect with the database server. Ports 8470, 8471, 8475, and 8476 have to be available from the client. If not, setting up a connection can take a very long time.
- You can find an overview of all port numbers and their functions here.
- Troubleshooting instructions are available here.
Logging and tracing
Logging and tracing DB2 connections can be enabled in the registry using the following keys (32/64 bit):
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\IBM\Client Access\CurrentVersion\Common\ManagedProvider\ServiceHKEY_LOCAL_MACHINE\SOFTWARE \IBM\Client Access\CurrentVersion\Common\ManagedProvider\Service
Logging and tracing DB2 connections
Performance optimizations
You can improve the performance of database connections and SQL for IBM i DB2 with the following settings:
- Ports - Make sure the required ports are open.
- Prestarted Jobs - Creating connections (jobs) takes a relatively long time for IBM i. Using Prestarted jobs prepares these connections in advance. Make sure that enough prestarted jobs are always available. See Prestart jobs.
- Separate subsystem - Query plans remain valid as long as the environment variables (load, disk space, free memory) remain stable. Therefore, we advise
placing the
QZDASOINITtasks into a separate subsystem based on, for example, an IP address. See IBM i Subsystems. - Plan cache - Increase the plan cache with the
QQQOOOCACHcommand, so query plans remain available long enough. See Plan cache.
Troubleshooting DB2 .NET Core drivers
Problems with activating the .NET Core drivers
To solve problems with activating the .NET Core drivers:
- Adjust Indicium's
web.config:
<aspNetCore ... >
<environmentVariables>
<environmentVariable name="Path" value="[Drive:\IndiciumPath]\clidriver\bin" />
</environmentVariables>
</aspNetCore>
Compatibility issues .NET Core with column types
In some cases, the DB2 .NET Core driver has compatibility issues with column types:
- XML
- DBCLOB.
Both column types can throw errors about not being able to perform the required CCSID conversion.
Running Indicium with the iSeries driver
We recommend using the newer .NET Core driver over the old IBM .NET Data Provider driver due to vast performance improvements. However, if you encounter the issue mentioned above, you can run the old IBM .NET Data Provider driver by using a plugin system.
Please note that since this means data now needs to travel between process boundaries from the plugin to Indicium, this method might degrade performance in some situations, compared to Indicium versions that previously used this driver directly. The most noticeable cases are:
- Selecting large data sets.
- Downloading file data stored in a database storage column.
To switch to the old IBM .NET Data Provider driver:
- Set the
DataProviders:DB2:Modeconfiguration setting toiSeries. - The number of plugin workers spawned can be modified using the
DataProviders:DB2:WorkerCountsetting. The default number is 3.
For example, using appsettings.json:
{
"DataProviders": {
"DB2": {
// Switch to using the old iSeries driver.
"Mode": "iSeries",
// Only spawn one plugin worker process instead of 3.
"WorkerCount": 1
}
}
}