Docs/CDC Setup

CDC Setup Guide

Configure Change Data Capture to keep your source and target databases in sync during migration. CDC enables near-zero-downtime cutover by streaming INSERT/UPDATE/DELETE events from Oracle, MySQL, or SQL Server to PostgreSQL.

OracleOracle LogMiner Setup

DBMigrateAIPro uses Oracle LogMiner to stream redo log events. Requires supplemental logging and DBMS_LOGMNR execute privilege.

Step 1: Enable supplemental logging

-- Enable at database level (DBA privilege required)
ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;

-- Enable ALL COLUMNS logging per table
ALTER TABLE HR.EMPLOYEES    ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;
ALTER TABLE HR.DEPARTMENTS  ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;
ALTER TABLE SALES.ORDERS    ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;

-- Verify
SELECT LOG_MODE, SUPPLEMENTAL_LOG_DATA_MIN,
       SUPPLEMENTAL_LOG_DATA_ALL
FROM   V$DATABASE;

Step 2: Grant required privileges

-- Grant LogMiner privileges to your migration user
GRANT SELECT ON V_$DATABASE        TO migret_user;
GRANT SELECT ON V_$LOGMNR_CONTENTS TO migret_user;
GRANT SELECT ON V_$LOGFILE         TO migret_user;
GRANT EXECUTE ON DBMS_LOGMNR       TO migret_user;
GRANT EXECUTE ON DBMS_LOGMNR_D     TO migret_user;

Step 3: Record the start SCN

Run this before starting the bulk migration. The SCN is your CDC resume point.

SELECT CURRENT_SCN, TO_CHAR(SYSDATE, 'YYYY-MM-DD HH24:MI:SS') AS captured_at
FROM   V$DATABASE;
-- Example output: 4829103  |  2026-04-20 08:15:33
-- Save 4829103 — use it as start_scn in CDC config

Step 4: Configure in DBMigrateAIPro

In the CDC panel, enter the SCN captured in Step 3. Select the tables to stream.

start_scn

4829103 (from Step 3)

poll_interval

5.0 seconds (default)

batch_size

1000 rows per poll

tables

HR.EMPLOYEES, HR.DEPARTMENTS

MySQLMySQL Binlog CDC Setup

MySQL CDC uses binary logging. Requires ROW format binlog and REPLICATION SLAVE privilege.

Enable binary logging (my.cnf)

[mysqld]
log_bin         = /var/log/mysql/mysql-bin.log
binlog_format   = ROW
binlog_row_image = FULL
server_id       = 1        # must be unique across replicas
expire_logs_days = 7       # keep 7 days of binlogs

Grant replication privilege

GRANT REPLICATION SLAVE ON *.*  TO 'migret_user'@'%';
GRANT SELECT ON your_db.*       TO 'migret_user'@'%';
FLUSH PRIVILEGES;

Common CDC Errors

ORA-01291: missing log file

Archive logs have been purged. Increase LOG_ARCHIVE_DEST retention or restart migration from current SCN.

ORA-06550: PLS-00302: NO_ROWID_IN_REDO

This LogMiner option is not supported on your Oracle version. Fixed in DBMigrateAIPro v2.0 — update your installation.

MySQL: Access denied for REPLICATION SLAVE

Run: GRANT REPLICATION SLAVE ON *.* TO 'user'@'%'; FLUSH PRIVILEGES;

Binlog not enabled

Add log_bin=ON and binlog_format=ROW to my.cnf in [mysqld] section, then restart MySQL.

SCN too old

The start SCN predates the oldest available archive log. Run a fresh migration from current SCN.