> ## Documentation Index
> Fetch the complete documentation index at: https://docs.risingwave.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Ingest data from Oracle CDC

> Ingest Oracle change data with a shared CDC source and backfill existing rows into RisingWave tables.

> [!TIP]
>
> **PREMIUM FEATURE**
>
> This is a premium feature. For a comprehensive overview of all premium features and their usage, see [RisingWave premium features](https://docs.risingwave.com/get-started/premium-features.md).

> [!WARNING]
>
> Oracle CDC is experimental. Test the connector with your workload before using it in production.

RisingWave can ingest changes from Oracle by using an embedded Debezium LogMiner connector. Create one shared source for an Oracle schema, and then create multiple RisingWave tables from it. When you create a table, RisingWave backfills its existing rows and merges changes that occur during the backfill before continuing with live CDC events.

## Prepare Oracle

Before creating the source, make sure that:

* Oracle runs in `ARCHIVELOG` mode with force logging and minimal supplemental logging enabled.
* All-column supplemental logging is enabled for each captured table, or at the PDB or CDB level.
* Each captured table has an enabled primary key backed by a valid, visible index.
* The connector user has the `SELECT_CATALOG_ROLE` and `EXECUTE_CATALOG_ROLE` roles and these privileges: `CREATE SESSION`, `SET CONTAINER`, `FLASHBACK ANY TABLE`, `SELECT ANY TABLE`, `SELECT ANY TRANSACTION`, `LOGMINING`, `LOCK ANY TABLE`, `CREATE TABLE`, and `CREATE SEQUENCE`.
* Redo logs are retained long enough for backfill and recovery. RisingWave does not automatically take a new snapshot if the required redo has expired.

Oracle CDC also requires a heartbeat table with two `NUMBER` columns named `ID` and `HEARTBEAT`, a single-column primary key on `ID`, and a seed row whose `ID` is `1`. The connector user must be able to update `HEARTBEAT`.

For manual setup, connect to the PDB that contains the captured tables (`ORCLPDB1` in the source example below). Run this SQL as the heartbeat-table owner (`RW_CDC` in this example), or ask your DBA to run it. The `RW_CDC` schema must already exist.

```sql theme={null}
CREATE TABLE RW_CDC.RW_HEARTBEAT (
  ID NUMBER(1) PRIMARY KEY,
  HEARTBEAT NUMBER(1) NOT NULL
);

INSERT INTO RW_CDC.RW_HEARTBEAT (ID, HEARTBEAT) VALUES (1, 0);
COMMIT;
```

Alternatively, set `heartbeat.table.auto.initialize = 'true'` to let RisingWave create and seed the table. Its schema must already exist. If the table belongs to a different user, grant the connector user `UPDATE (HEARTBEAT)` on that table.

## Create a shared source

Create a source that connects to the Oracle container database (CDB) and selects a pluggable database (PDB) and schema:

```sql theme={null}
CREATE SOURCE oracle_source WITH (
  connector = 'oracle-cdc',
  hostname = 'oracle.example.com',
  port = '1521',
  username = 'RW_CDC',
  password = 'secret',
  database.name = 'ORCLCDB',
  database.pdb.name = 'ORCLPDB1',
  schema.name = 'APP',
  heartbeat.table.name = 'RW_CDC.RW_HEARTBEAT',
  heartbeat.table.auto.initialize = 'true'
) FORMAT PLAIN ENCODE JSON;
```

The following source parameters are specific to Oracle CDC. The standard connection parameters in the example are required.

| Parameter | Description |
| :- | :- |
| `database.name` | Oracle CDB service name. |
| `database.pdb.name` | PDB that contains the captured tables. |
| `schema.name` | Schema to capture. Oracle identifiers are matched exactly. |
| `heartbeat.table.name` | Heartbeat table in `schema.table` format. This parameter is required. |
| `heartbeat.table.auto.initialize` | **Optional.** If `true`, RisingWave creates and seeds the heartbeat table when necessary. The default is `false`. |
| `debezium.rac.nodes` | Comma-separated Oracle RAC node addresses. Required when Oracle RAC is enabled. |
| `debezium.database.connection.adapter` | **Optional.** LogMiner adapter. Accepted values are `logminer_unbuffered` (default) and `logminer`. |

The default `logminer_unbuffered` adapter keeps open transactions in Oracle until they commit. The `logminer` adapter buffers open transactions in the connector node's memory. With either adapter, many concurrent large transactions can exhaust memory on the side that buffers them.

## Create tables and backfill data

You can let RisingWave discover the upstream columns and primary key:

```sql theme={null}
CREATE TABLE orders (*)
FROM oracle_source TABLE 'APP.ORDERS';
```

The `TABLE` value must contain exactly `schema.table`. RisingWave matches both identifier parts exactly and does not apply Oracle's usual uppercase conversion. For an Oracle table created with unquoted identifiers, use its uppercase catalog name, as in `APP.ORDERS`. Identifiers containing periods are not supported.

You can also declare the schema explicitly. Quoted RisingWave column names preserve the uppercase Oracle column names:

```sql theme={null}
CREATE TABLE customers (
  "ID" INT,
  "NAME" VARCHAR,
  PRIMARY KEY ("ID")
) FROM oracle_source TABLE 'APP.CUSTOMERS';
```

By default, table creation backfills existing rows. To consume only changes that occur after table creation, disable the snapshot:

```sql theme={null}
CREATE TABLE new_orders (*)
WITH (snapshot = 'false')
FROM oracle_source TABLE 'APP.ORDERS';
```

## Limitations

* Parallelized CDC table backfill is not supported. Oracle CDC reads each table in primary-key order with one snapshot reader. This is separate from [Cloud serverless backfilling](https://docs.risingwave.com/processing/serverless-backfill.md), which runs materialized view, sink, and index backfill on dedicated resources.
* The order of a composite primary key in the RisingWave table must match the Oracle primary-key index.
* Automatic schema change is not supported.
* Committed changes are delivered, but changes from one Oracle transaction are not guaranteed to become visible atomically downstream.
* `LONG`, `LONG RAW`, `UROWID`, Oracle 23 `BOOLEAN`, and `XMLTYPE` columns are not supported.
* If `debezium.time.precision.mode = 'connect'`, a `TIMESTAMP` primary key with fractional precision greater than 3 is not supported. Omit this option to use the default microsecond precision.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.