Sources

IBM Db2

ASN/SQL-replication change-data tables on self-managed Db2 LUW — capture setup, the register table, and the capture program.

IBM Db2 (LUW) sources are read through SQL replication (ASN) change-data tables, not log-tailing. Db2 has no free, unlicensed equivalent of Postgres logical decoding or MySQL's binlog — continuous log capture is only available through the separately licensed InfoSphere CDC / Q Replication. Fabric instead polls the CD tables that Db2's own Capture program maintains, ordered by (IBMSNAP_COMMITSEQ, IBMSNAP_INTENTSEQ).

Supported deployments

Db2 on Linux, UNIX, and Windows (LUW), self-managed. The ASN Capture program has to be running on the source instance — Fabric refuses to start without it — so a Db2 deployment that does not expose it cannot be used as a source.

Prerequisites

ASN capture and CD tables must already exist

Fabric does not provision replication for you. Before adding a Db2 source, an administrator runs the ASNCLP capture setup (or the Replication Center) for each table you plan to sync:

asnclp SQL -SOURCEDB mydb -TARGETDB mydb -USER db2inst1 -PASSWORD ...
SET SERVER CAPTURE;
ADD TABLE (SCHEMA."CUSTOMERS")
  CHANGE KEY (ID)
  CAPTURE ID SPECIFIED VALUE (1);
GENERATE SCRIPT 'setup.sql';
RUN SCRIPT 'setup.sql';

This provisions a CD table (e.g. ASN.CDC_CUSTOMERS) and a row in ASN.IBMSNAP_REGISTER for each source table. A selected table with no registration row is refused by name — Fabric resolves the CD table via that registry rather than guessing a naming convention.

The capture program must be running

The ASN Capture program is what actually fills the CD tables from the Db2 recovery log. Fabric checks ASN.IBMSNAP_CAPPARMS.CAPTURE_STATE at preflight and refuses to start if capture is stopped:

asncap CAPTURE_SCHEMA=ASN CAPTURE_SERVER=mydb &

A read-only login

Fabric's login needs SELECT on the ASN schema's CD tables and register table, and on the base tables for snapshot and schema discovery:

GRANT SELECT ON SCHEMA ASN TO USER fabric_cdc;
GRANT SELECT ON TABLE SCHEMA.CUSTOMERS TO USER fabric_cdc;

Network and driver

The runner reaches host:50000 (Db2's default port) using the ibm_db driver bundled with Fabric. There is no ODBC DSN to configure — the connector builds the connection string directly from the source's host, port, database, and credentials.

Connection fields

FieldRequiredDefaultNotes
Connector nameYes—Unique across sources.
HostYes—
PortYes50000
UsernameYes—Login used for polling and snapshot.
PasswordYes on create—Leave blank on edit to keep the stored password.
DatabaseYes—A single catalog database. Read-only after creation.
ASN schemaNoASNThe schema holding IBMSNAP_REGISTER and the CD tables, if the ASNCLP setup used a non-default name.

The shared snapshot and commit fields apply on top of these — see the source overview.

How it replicates

  • Fabric resolves each selected table's CD table by looking it up in ASN.IBMSNAP_REGISTER, then polls it with a bookmark on (IBMSNAP_COMMITSEQ, IBMSNAP_INTENTSEQ), ordered by both columns — the second field breaks ties within one commit, since a single transaction can change several rows.
  • IBMSNAP_OPERATION (I/U/D) maps directly to insert/update/delete; unlike SQL Server's CT tables, a Db2 CD row is already one row per change, with no update pairs to collapse.
  • The snapshot captures the current maximum IBMSNAP_COMMITSEQ before scanning and checkpoints per-table progress, so a mid-snapshot crash resumes under the same mark instead of skipping changes.
  • Snapshot chunking uses a single-column unique or primary-key index; a table with no safe key falls back to one unchunked pass.

Gotchas

Watch out

  • A selected table with no ASN.IBMSNAP_REGISTER row is refused by name — Fabric never invents a CD table name.
  • A stopped Capture program is the classic silent failure: CD tables stay empty and the poller sees no rows even though the register entry exists.
  • Db2's replication lag has no cheap numeric distance the way an LSN offers one — Fabric does not report a lag estimate for Db2 sources.
  • A login failure is treated as a held state, not a crash loop — the source shows held with the refusal reason.