Prerequisites
The following section describes the prerequisites for working with the IBM DB2 for LUW endpoint.
Driver setup
Replicate supports driver version 12.1.x only. The instructions assume you are installing version 12.1.4.
Replicate on Windows
- Download IBM Data Server Client 12.1.4 (v12.1.4_ntx64_client.exe) from IBM Fix Central.
- Install it on the Qlik Replicate Server machine.
Replicate server on Linux
The following steps need to be performed on the Replicate machine:
-
Download the IBM Data Server Driver for ODBC and CLI 12.1.4 (v12.1.4_linuxx64_odbc_cli.tar.gz) from IBM Fix Central.
-
Stop the Replicate service and optionally confirm that it has stopped as described in Replicate server procedures.
-
Unzip v12.1.4_linuxx64_odbc_cli.tar.gz and extract the files. Then run the installation, choosing the “CLIENT” option.
For guidance, see Installing the Db2 driver package on Linux.
-
If the Replicate machine does not have a DB2 instance, create a DB2 instance by running the following commands:
adduser <db2_instance_name>
/opt/ibm/db2/V12.1.4/instance/db2icrt <db2_instance_name>
-
Change the working directory to <Replicate_Install_Dir>/bin.
-
Add the DB2 driver location to the Linux library path.
To do this, add the following line to the site_ arep_login.sh file as follows:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/lib
where path is the CLIENT path to the driver.
Example (with db2clnt1 as the instance name):
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/db2clnt1/sqllib/lib:/home/db2clnt1/sqllib/lib64/gskit
export DB2INSTANCE=db2clnt1
-
Optionally, confirm that the driver location was copied:
cat site_arep_login.sh -
Add the following entry to the odbcinst.ini file under /etc:
[IBM DB2 ODBC DRIVER]
Driver = /home/db2clnt1/sqllib/lib/libdb2o.so
fileusage=1
dontdlclose=1
-
Start the Replicate service and optionally confirm that it has started as described in Replicate server procedures.
-
Define the IBM DB2 for LUW connection settings as described in Setting general connection properties and click Test Connection.
If you get the following error:
Cannot connect to DB2 LUW Server ODBC unknown error.
RetCode: SQL_ERROR SqlState: NativeError: -1390 Message: [unixODBC][IBM][CLI Driver] SQL10007N Message "0" could not be retrieved. Reason code: "3". ODBC general error.
-
Run the following command:
/opt/ibm/db2/V12.1.4/bin /db2cli writecfg add -database <db_name_from_endpoint_connection_settings> -host <server_name_from_endpoint_connection_settings> -port <port_from_endpoint_connection_settings>
-
Change to the Replicate bin directory (<install_dir>/bin). Then, stop and start the Replicate service as described in Replicate server procedures.
-
IBM DB2 for LUW server prerequisites
The following permissions must be granted to the user specified in the endpoint settings:
-
SCHEMAADM privilege on target schemas. This allows Replicate to create, delete, and update tables in the target schemas.
-
The IBM LOAD command run by Replicate requires:
-
DATAACCESS authority on the database and relevant schemas (included in the SCHEMAADM).
-
LOAD authority on the database or the schemas with the following privileges:
-
INSERT or INSERTIN privilege on the table.
-
INSERTIN privilege on the schema that contains the exception table, if used.
-
-