Connecting InfoSphere Data Replication to a Db2 database

You can connect IBM® InfoSphere Data Replication Version 11.3.3.3-50 or later to a Db2 Warehouse target database. This capability applies to both SMP and MPP environments. It does not apply to the trial version of Db2 Warehouse.

Before you begin

If you are using Db2 Warehouse, you have a choice of two deployment models:
  • Local deployment, where IBM InfoSphere Data Replication and Db2 Warehouse run inside the same Docker container
  • Remote deployment, where IBM InfoSphere Data Replication runs outside the Db2 Warehouse Docker container
The information in this "Before you begin" section applies only to the remote deployment model of Db2 Warehouse.

Obtain Db2 Warehouse client container that applies to your machine’s operating system. The most recent version of IBM Data Server Client package and other support tools are always included inside. Using this version is recommended as it includes latest features and fixes, and guarantees correct operation of the tools; see Deploying the IBM Db2 Warehouse client container (Linux). Alternatively, you can also download and install the package as described in IBM Data Server Client, but some features might not work.

If you intend to connect by using the SSL protocol, download and install IBM Global Security Kit (GSKit) V8. See GSKit V8 - Install, Uninstall and Upgrade instructions. Click the operating system tab that applies to your client machine’s operating system. If you are installing the GSKit on a Windows computer, ensure that you specify the GSKit installation directory path (installation_directory\gsk8\bin) for the PATH environment variable.

Before you can connect to your database, you must carry out the following steps:
  • Verify prerequisites, including installing driver packages, configuring your local environment, and downloading SSL certificates (if needed)

  • Collect connect information, including database details such as host name and port numbers, and connect credentials such as user ID and password

If you intend to connect by using the SSL protocol, download the DigiCertGlobalRootCA.crt SSL certificate from the web console to a directory on the client machine. To download the certificate, click Connection > Connection Information and then click the Connection with SSL tab.

About this task

Procedure

  1. If you are using Db2 Warehouse with the remote deployment model, use one of the following approaches. This step does not apply if you are using Db2 Warehouse with the local deployment model.
    • To create a connection by using SSL, complete the following steps:
      1. Issue the following command:
        cd /ssl_directory_name/ssl
        where /ssl_directory_name/ssl is the path to the directory into which you downloaded the DigiCertGlobalRootCA.crt SSL certificate.
      2. Create a client key database and a stash file by using the GSKCapiCmd tool. For example, the following command creates a client key database called dashclient.kdb and a stash file called dashclient.sth:
        gsk8capicmd_64 -keydb -create -db "dashclient.kdb" -pw "passw0rdpw0" -stash
        where passw0rdpw0 is a password. The -stash option creates a stash file in the same path as that of the client key database, with a file extension of .sth. At connection time, IBM Global Security Kit (GSKit) uses the stash file to obtain the password to the client key database.
      3. Add the certificate to the client key database. For example, the following gsk8capicmd command imports the certificate from the /ssl_directory_name/ssl/DigiCertGlobalRootCA.crt file into the client key database called dashclient.kdb:
        gsk8capicmd_64 -cert -add -db "dashclient.kdb" -pw "passw0rdpw0" -label "DigiCert" -file "/ssl_directory_name/ssl/DigiCertGlobalRootCA.crt" -format ascii -fips
      4. Update the values of the SSL_CLNT_KEYDB and SSL_CLNT_STASH database manager configuration parameters on the client to specify the client key database and the stash file. Examples follow:
        db2 update dbm cfg using SSL_CLNT_KEYDB /ssl_directory_name/ssl/dashclient.kdb
        db2 update dbm cfg using SSL_CLNT_STASH /ssl_directory_name/ssl/dashclient.sth
      5. Catalog the Db2 Warehouse node so that client applications can connect to it. Issue the following command:
        db2 catalog tcpip node node_name remote Db2_Warehouse_IP_address server port security ssl
        where:
        • node_name is your name for the node.
        • Db2_Warehouse_IP_address is the IP address of the Db2 Warehouse server.
        • port is the port that is used to connect to Db2 Warehouse by using an SSL connection. If you are using the default port, specify 50001.
      6. Catalog the remote Db2 Warehouse database so that client applications can connect to it. Issue the following command:
        db2 catalog database bludb as db_alias at node node_name
        where db_alias is your name for the Db2 Warehouse database.
      7. Test the SSL connection in one of the following ways:
        • Test the connection using CLP by issuing the following command to connect to the Db2 Warehouse database:
          db2 connect to db_alias user user_id
          where user_id is your Db2 Warehouse user ID. You are prompted to enter your password.
        • Test the connection using CLI by issuing the following command to connect to the Db2 Warehouse database:
          db2cli validate -dsn alias -connect -user user_id -passwd password
          where alias is an alias that you created by using the db2cli writecfg command, user_id is your Db2 Warehouse user ID, and password is your Db2 Warehouse password.
    • To create a connection without using SSL, complete the following steps:
      1. Catalog the Db2 Warehouse node so that client applications can connect to it. Issue the following command:
        db2 catalog tcpip node node_name remote Db2_Warehouse_IP_address server port
        where:
        • node_name is your name for the node.
        • Db2_Warehouse_IP_address is the IP address of the Db2 Warehouse server.
        • port is the port that is used to connect to Db2 Warehouse without using an SSL connection. If you are using the default port, specify 50000.
      2. Catalog the remote Db2 Warehouse database so that client applications can connect to it. Issue the following command:
        db2 catalog database bludb as db_alias at node node_name
        where db_alias is your name for the Db2 Warehouse database.
      3. Test the non-SSL connection in one of the following ways:
        • Test the connection using CLP by issuing the following command to connect to the Db2 Warehouse database:
          db2 connect to db_alias user user_id
          where user_id is your Db2 Warehouse user ID. You are prompted to enter your password.
        • Test the connection using CLI by issuing the following command to connect to the Db2 Warehouse database:
          db2cli validate -dsn alias -connect -user user_id -passwd password
          where alias is an alias that you created by using the db2cli writecfg command, user_id is your Db2 Warehouse user ID, and password is your Db2 Warehouse password.
  2. Launch the InfoSphere Data Replication configuration tool and perform the following steps. The values that are shown in the screen captures are examples.
    1. Add a source instance to point to your source database by using the Instance Configuration tab:
    2. Add a target instance to point to your target Db2 database by using the Instance Configuration tab. If you are not using IBM InfoSphere Data Replication 11.3.3.3-50 or later, do not select the Specify refresh loader path check box.

    3. Start each instance:
  3. Launch the InfoSphere Data Replication management console and use Access Manager to complete the following steps:
    1. Create a datastore to connect to your source instance by using the Datastore tab. Because a Db2 database is not supported as a source database, you must provide user and password information for the source database by clicking Connection Parameters.
    2. Create a datastore to connect to your target instance by using the Datastore tab. You must provide user and password information by clicking Connection Parameters.
    3. If the user (for example, admin) that will connect to the Access Server does not exist, create that user:
    4. Click the Access Manager tab.
    5. On the Datastore Management tab, assign the user to both the source and target datastores by right-clicking each datastore and then clicking Assign User. Ensure that the credentials for accessing each instance are correct.

What to do next

Define a subscription and perform data replication. For information, see Loading data from InfoSphere Data Replication.