Create a sync user for ELT & CDC by executing the following SQL as a DBA user:
-- Create the sync userCREATE USER integrateio IDENTIFIED BY "BxI8NPnFGVdwLXi4CS7M" DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp QUOTA UNLIMITED ON users;-- Grant basic connection privilegesGRANT CREATE SESSION TO integrateio;
Specify the schema containing the tables you want to sync:
-- Grant LogMiner privilegesGRANT EXECUTE ON DBMS_LOGMNR TO integrateio;GRANT EXECUTE ON DBMS_LOGMNR_D TO integrateio;-- Grant access to LogMiner viewsGRANT SELECT ON V_$LOG TO integrateio;GRANT SELECT ON V_$LOGFILE TO integrateio;GRANT SELECT ON V_$LOGMNR_CONTENTS TO integrateio;GRANT SELECT ON V_$LOGMNR_LOGS TO integrateio;GRANT SELECT ON V_$ARCHIVED_LOG TO integrateio;GRANT SELECT ON V_$DATABASE TO integrateio;GRANT SELECT ON V_$INSTANCE TO integrateio;-- Grant access to dictionary viewsGRANT SELECT ON DBA_OBJECTS TO integrateio;GRANT SELECT ON DBA_TABLES TO integrateio;GRANT SELECT ON DBA_TAB_COLUMNS TO integrateio;GRANT SELECT ON DBA_CONSTRAINTS TO integrateio;GRANT SELECT ON DBA_CONS_COLUMNS TO integrateio;GRANT SELECT ON DBA_LOG_GROUPS TO integrateio;GRANT SELECT ON DBA_LOG_GROUP_COLUMNS TO integrateio;-- Grant SELECT on all tables in the source schemaGRANT SELECT ANY TABLE TO integrateio;-- For Oracle 12c and above, grant LOGMINING privilegeGRANT LOGMINING TO integrateio;
Enable supplemental logging to capture change data. Run the following queries as a DBA user:
1
Check ARCHIVELOG ModeFirst, verify that the database is running in ARCHIVELOG mode:
-- Check if database is in ARCHIVELOG modeSELECT LOG_MODE FROM V$DATABASE;
If not in ARCHIVELOG mode, enable it (requires database restart):
-- Enable ARCHIVELOG mode (if needed)-- WARNING: This requires a database restartSHUTDOWN IMMEDIATE;STARTUP MOUNT;ALTER DATABASE ARCHIVELOG;ALTER DATABASE OPEN;
2
Enable Database-Level Supplemental Logging
-- Enable minimal supplemental logging at database levelALTER DATABASE ADD SUPPLEMENTAL LOG DATA;-- Optionally, enable primary key and unique index loggingALTER DATABASE ADD SUPPLEMENTAL LOG DATA (PRIMARY KEY, UNIQUE) COLUMNS;
3
Enable Table-Level Supplemental LoggingEnable supplemental logging for each table you want to sync. You can enable logging for all columns or just primary key columns:
-- For each table you want to syncALTER TABLE <schema_name>.<table_name> ADD SUPPLEMENTAL LOG DATA (ALL) COLUMNS;