IBM Db2 Environment Preparation

  • Last update: September 25, 2024
  • Overview 

    Version 

    FineDataLink VersionFunctional Change
    4.1.4/

    By enabling Change Data Capture (CDC) for the data source, you can synchronize real-time data from data sources using the Data Pipeline function of FineDataLink. 

    FineDataLink's Data Pipeline supports CDC for Db2 databases. This section describes how to enable CDC for the Db2 database.

    Configure the database following this document before executing a synchronization task.

    iconNote:
    If the Db2 database user you use experiences authentication issues, use the root user to grant the user privileges and then proceed with configuration using the database user.

    Enabling Archive Log 

    Use the default user db2inst1 to connect to the database.

    su - db2inst1
    db2 connect to <Database name>


    Check the first log archive method of the database currently. If it returns OFF, the archive logging is not enabled.

    Use the following command to modify the database logging mode.

    db2 update db cfg for <Database name> using LOGARCHMETH1 <Archive Log Path>

    iconNote:
    To archive the log in a specified directory, you need to grant privileges first.

    Disconnect other applications from the database.

    db2 force applications all


    After you enable archive logging for the Db2 database for the first time, the database is in a BACKUP PENDING state, necessitating a full backup.

    db2 backup db <Database name>


    Connect to the database and confirm that archive logging is enabled.

    db2 connect to <Database name>
    db2 get db cfg for <Database name> | grep -i LOGARCHMETH1


    Initializing the Db2 ASN Capture Program 

    After you enable archive logging and CDC for the Db2 database, Db2 ASN Capture captures the INSERT, DELETE, and UPDATE operations on the subscribed tables and writes them into the CDC tables. CloudCanal then scans these tables for incremental synchronization.

    Use the following script to initialize the Db2 ASN Capture program.

    db2-cdc-script.zip

    Extract the db2-cdc-script file into the database user's home directory.

    Place the file in the root user's directory, for example, the home directory of the root user.

    Use the following command to copy the file and paste to the database user's directory.

    docker cp db2-cdc-script/ db2-11:/database/config/db2inst1/

    Enter the db2-cdc-script directory in the /database/config/db2inst1 path.

    Grant privileges on this folder.

    chmod -R +777 /db2-cdc-script

    Switch to the database user.

     su - db2inst1

    Enter the db2-cdc-script directory and run the script, as shown in the following figure.

    cd /db2-cdc-script
    bash ~/db2-cdc-script/cdc_setup.sh <Databae name>

    The following figure shows the effect of the successful execution.

    Database User Privilege 

    To use the Db2 data connection in FineDataLink, ensure that the database user you use has the execution privilege on corresponding stored procedures and the SELECT privilege on source tables, CDC tables, and configuration tables.

    Subsequent Operation 

    Connect FineDataLink to the IBM Db2 database, set the IBM Db2 database to the data source, and configure the pipeline task.

    附件列表


    主题: Data Pipeline
    Previous
    Next
    • Helpful
    • Not helpful
    • Only read

    滑鼠選中內容,快速回饋問題

    滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。

    不再提示

    10s後關閉

    Get
    Help
    Online Support
    Professional technical support is provided to quickly help you solve problems.
    Online support is available from 9:00-12:00 and 13:30-17:30 on weekdays.
    Page Feedback
    You can provide suggestions and feedback for the current web page.
    Pre-Sales Consultation
    Business Consultation
    Business: international@fanruan.com
    Support: support@fanruan.com
    Page Feedback
    *Problem Type
    Cannot be empty
    Problem Description
    0/1000
    Cannot be empty

    Submitted successfully

    Network busy