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.
Use the default user db2inst1 to connect to the database.
su - db2inst1db2 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>
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
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-scriptbash ~/db2-cdc-script/cdc_setup.sh <Databae name>
The following figure shows the effect of the successful execution.
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.
Connect FineDataLink to the IBM Db2 database, set the IBM Db2 database to the data source, and configure the pipeline task.
滑鼠選中內容,快速回饋問題
滑鼠選中存在疑惑的內容,即可快速回饋問題,我們將會跟進處理。
不再提示
10s後關閉
Submitted successfully
Network busy