Stream CDC Data from Oracle
- how-to
To continuously load change data capture (CDC) events from an Oracle database into Enterprise Analytics, you configure the Debezium Oracle connector to publish changes to a Kafka topic, then create a Kafka link and collection in Enterprise Analytics.
The Debezium Oracle connector captures row-level changes in Oracle tables and publishes them as JSON events to a Kafka topic. Enterprise Analytics reads from that topic using a Kafka link.
Prerequisites
-
A running Kafka cluster with a Debezium connector configured for your Oracle database, producing messages in JSON, Avro, or Protobuf format.
-
If using JSON format, schema embedding must be disabled for both key and value converters in your Debezium configuration:
key.converter.schemas.enable=false value.converter.schemas.enable=false
-
A Kafka link in Enterprise Analytics. See Create a Kafka Pipeline Link.
Create an Enterprise Analytics Collection
The Kafka topic for an Oracle table follows the naming convention <topic.prefix>.<schema>.<table>.
For example, if topic.prefix is oracle, the schema is ADMIN, and the table is ORDERS, the topic name is oracle.ADMIN.ORDERS.
The following example creates a collection on a Kafka link to ingest Debezium Oracle CDC records:
CREATE COLLECTION `Default`.`Default`.oracleOrders
PRIMARY KEY (ID: bigint)
ON `oracle.ADMIN.ORDERS` AT kafkaLink
WITH {
"storage-format": {"format": "column"},
"kafka-sink": "true",
"keySerializationType": "JSON",
"valueSerializationType": "JSON",
"cdcEnabled": "true",
"cdcDetails": {
"cdcSource": "ORACLE",
"cdcSourceConnector": "DEBEZIUM"
}
};
| Parameter | Description |
|---|---|
|
The primary key field and its data type. Must match a column in the Oracle table. |
|
The Kafka topic name. Must match the topic the Debezium connector publishes to. |
|
The name of the Kafka link that connects to your Kafka cluster. |
|
Set to |
|
Set to |
|
Set to |
To start ingesting data, connect the Kafka link:
CONNECT LINK kafkaLink;
Data Type Handling and Limitations
During ingestion, Debezium may convert Oracle types in ways that differ from the native Oracle representation.
Ingestion is performed based on the contents of the after field in each event.
No schema metadata is used.
The following table shows how Oracle types map to Enterprise Analytics types with the default Debezium configuration.
| Oracle Type | Enterprise Analytics Type |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Unsupported Oracle Types
The following Oracle types are not supported by Debezium:
-
BFILE(binary file) -
BOOLEAN -
Direct joins in the
FROMclause ofUPDATEandDELETEstatements -
Data Use Case Domains
-
JavaScript-based stored procedures
-
LONG -
LONG RAW -
ROWID(not supported on XStream) -
Table value constructors (TVCs)
-
UROWID(Universal ROWID) -
VECTOR
Debezium Configuration Options
Debezium provides configuration options to reduce data type mismatches.
For example, setting decimal.handling.mode = double causes Oracle decimal values to be ingested as DOUBLE values in Kafka.
For a full list of options, see the Debezium Oracle connector documentation.
| Test your complete data model with all expected data types before deploying to production to verify data is ingested as expected under your chosen configuration. |