Skip to main content

SnapshotLog Connector

solutions.a2.cdc.oracle.runtime.thread.KafkaSourceSnapshotLogConnector reads changes from Oracle Database materialized view logs as a source for data changes and materializes them at a heterogeneous database system.

warning

This connector is not recommended for production use due to the very large load it creates on the database. Consider using the RedoMiner Connector instead.

Prerequisites​

No materialized view should consume information from materialized view logs used by this connector.

The user running the connector must have the following privileges:

GRANT SELECT ON V_$INSTANCE TO <CONNECTOR-USER>;
GRANT SELECT ON V_$LICENSE TO <CONNECTOR-USER>;
GRANT SELECT ON V_$DATABASE TO <CONNECTOR-USER>;

In addition, the user needs read privileges on the underlying base tables and materialized view logs.

Creating Materialized View Logs​

Create materialized view logs over replicated tables with these options:

  • WITH PRIMARY KEY and/or WITH ROWID
  • SEQUENCE
  • EXCLUDING NEW VALUES
  • Without COMMIT SCN option

You do not need to specify a column list when creating materialized view logs for use with oracdc. The connector reads only the primary key value and/or ROWID of the row in the master table.

Operation Modes​

Snapshot Log WithMaster Table AccessKey for External System
Primary keyPrimary keyPrimary key
Primary key and ROWIDROWIDPrimary key
ROWIDROWIDROWID (String, key name ORA_ROW_ID)

Example Setup​

CONNECT scott/tiger

CREATE TABLE DEPT (
DEPTNO NUMBER(2) CONSTRAINT PK_DEPT PRIMARY KEY,
DNAME VARCHAR2(14),
LOC VARCHAR2(13)
);

CREATE TABLE EMP (
EMPNO NUMBER(4) CONSTRAINT PK_EMP PRIMARY KEY,
ENAME VARCHAR2(10),
JOB VARCHAR2(9),
MGR NUMBER(4),
HIREDATE DATE,
SAL NUMBER(7,2),
COMM NUMBER(7,2),
DEPTNO NUMBER(2) CONSTRAINT FK_DEPTNO REFERENCES DEPT
);

CREATE MATERIALIZED VIEW LOG ON DEPT
WITH PRIMARY KEY, SEQUENCE
EXCLUDING NEW VALUES;

CREATE MATERIALIZED VIEW LOG ON EMP
WITH PRIMARY KEY, SEQUENCE
EXCLUDING NEW VALUES;