Using ODI Change Data Capture (Journalizing)

When loading data into a data warehouse, instead of comparing all the data in the source table with the target every time, after the initial load we can compare only the changed records and complete the load by working on a much smaller data set. For detecting changed records, we can take advantage of the Journalizing feature that ODI offers us. In this post, we will cover, at a basic level, how to capture changed data (CDC) and merge it with the target table (MERGE) in ODI.

First, let’s create the tables that will help us with the explanation;

Source Table :

CREATE TABLE CDC_SOURCE ( KISI_ID NUMBER NOT NULL PRIMARY KEY, AD VARCHAR2(50 BYTE), SOYAD VARCHAR2(50 BYTE) );

* A primary key must be defined on the source table.

Target Table :

CREATE TABLE CDC_TARGET ( KISI_ID NUMBER, AD VARCHAR2(50 BYTE), SOYAD VARCHAR2(50 BYTE) );

I assume that the two have been synchronized initially through an initial load or the like. In our example, both are empty, so they are equal anyway ^^

We add our tables to the model using Reverse Engineer.

Using ODI Change Data Capture (Journalizing) | image - 1

After this step, we should be able to see the source and target tables under their own models.

Using ODI Change Data Capture (Journalizing) | image - 2

In the model, we right-click the source table and select Add to CDC under the Change Data Capture menu.

Using ODI Change Data Capture (Journalizing) | image - 3

After answering yes to the confirmation question that appears at this stage, if you see a yellow clock icon on the source table

Using ODI Change Data Capture (Journalizing) | image - 4.

indicating that it is included in CDC, then everything is fine so far.

If everything is fine so far, we can select Start Journal, again under the Change Data Capture menu.

Using ODI Change Data Capture (Journalizing) | image - 5

When we select SUNOPSIS as the Subscriber and continue, the color of the clock icon on the source table should change from yellow to green.

Using ODI Change Data Capture (Journalizing) | image - 6

As of now, ODI has started journalizing. Let’s check by inserting a few sample records.

INSERT INTO CDC_SOURCE (KISI_ID, AD, SOYAD) VALUES (1, ‘METİN’, ‘TEKİN’); INSERT INTO CDC_SOURCE (KISI_ID, AD, SOYAD) VALUES (2, ‘ALİ’, ‘GÜLTİKEN’);

If we run the relevant scripts in sqlplus and then select the Journal Data option on the source table in ODI, we will see that it has captured the changed records.

Using ODI Change Data Capture (Journalizing) | image - 7

*** So far we have only captured the changed records. To apply them to the target table, we need to prepare an Interface.

There are 2 points we need to pay particular attention to in the Interface step. The first is that, in the Mapping tab, we must have checked the Journalized Data only option in the Property Inspector screen of the source table,

Using ODI Change Data Capture (Journalizing) | image - 8

The other is that we must choose the JKM and IKM modules we will use according to our needs. In this example, I used JKM Oracle Simple as the JKM and IKM Oracle Incremental Update (MERGE) as the IKM. Depending on your needs, you can use one of the SCD modules or another module.

Using ODI Change Data Capture (Journalizing) | image - 9

After running the interface we prepared, if we check the target table, we will see that the changes have been applied to the target.

Using ODI Change Data Capture (Journalizing) | image - 10

* At this stage, ODI resets the Journal table.

Let’s complete the topic with one more test; let’s see what happens after inserting one record and updating an existing record.

INSERT INTO CDC_SOURCE (KISI_ID, AD, SOYAD) VALUES (3, ‘FEYYAZ’, ‘UÇAR’); UPDATE CDC_SOURCE SET SOYAD = ‘SARIFIRTINA’ WHERE KISI_ID = 1;

Journal Data;

Using ODI Change Data Capture (Journalizing) | image - 11

The target table (CDC_TARGET) after running the interface again ;

Using ODI Change Data Capture (Journalizing) | image - 12

If you generate a scenario for the interface and schedule it, you can keep the data in your target table synchronized with the source table at the interval you specify. Good luck.

Adnan Ersöz26 August 2013
The source of this content is https://aersoz.wordpress.com.
© 2026 KDS Data. All rights reserved.