Changed Data Capture (CDC) allows Oracle Data Integrator to track changes in source data caused by other applications. When running integration interfaces, thanks to CDC, Oracle Data Integrator can avoid processing unchanged data in the flow.
Reducing the source data flow to only changed data is useful in many contexts, such as data synchronization and replication. It is essential when setting up an event-oriented architecture for integration. In such an architecture, applications make changes in the data ("Customer Deletion", "New Purchase Order") during a business process. These changes are captured by Oracle Data Integrator and transformed into events that are propagated throughout the information system
Steps to Implement CDC
In the Models tree in the Designer Navigator, select the model that you want to journalize.
Double-click this model to edit it.
In the Journalizing tab, select the journalizing mode you want to use: Consistent Set or Simple.
Select the Journalizing Knowledge Module (JKM) you want to use for this model. Only Knowledge Modules suitable for the data model's technology and journalizing mode, and that have been previously imported into at least one of your projects will appear in the list.
Set the Options for this KM.
In the source table that needs to be setup for CDC select the table > Select Change Capture > Add to CDC
To add or remove datastores for the CDC:
Right-click the model, sub-model or datastore that you want to add to/remove from the CDC in the Model tree in the Designer Navigator.
Right-click then select Changed Data Capture > Add to CDC or Changed Data Capture > Remove from CDC to add to the CDC or remove from the CDC the selected datastore, or all datastores in the selected model/sub-model.
Add or remove subscribers:
Each subscriber consumes in a separate thread changes that occur on individual datastores for Simple Journalizing or on a model for Consistent Set Journalizing. Adding or removing a subscriber registers it to the CDC infrastructure in order to trap changes for it.
To add subscribers:
In the Models tree in the Designer Navigator, select the journalized data model if using Consistent Set Journalizing or select a data model or an individual datastore if using Simple Journalizing.
Right-click, then select Changed Data Capture > Subscriber > Subscribe. A window appears which lets you select your subscribers.
Type a Subscriber name, then click the Add Subscriber button. Repeat the operation for each subscriber you want to add.
The table added to CDC should now have a marker icon. The journal icon represents a small clock. It should be yellow, indicating that the journal infrastructure is not yet in place.
It is possible to add datastores to the CDC after the journal creation phase. In this case, the journals should be re-started.
If a datastore with journals running is removed from the CDC in simple mode, the journals should be stopped for this individual datastore. If a datastore is removed from CDC in Consistent Set mode, the journals should be restarted for the model (Journalizing information is preserved for the other datastores).
Set the datastores order (consistent set journalizing only):
You only need to arrange the datastores in order when using consistent set journalizing. You should arrange the datastores in the consistent set in an order which preserves referential integrity when using their changed data. For example, if an ORDER table has references imported from an ORDER_LINE datastore (i.e. ORDER_LINE has a foreign key constraint that references ORDER), and both are added to the CDC, the ORDER datastore should come before ORDER_LINE. If the PRODUCT datastore has references imported from both ORDER and ORDER_LINE (i.e. both ORDER and ORDER_LINE have foreign key constraints to the PRODUCT table), its order should be lower still.
Start/Drop the journals:
Starting the journals creates the CDC infrastructure if it does not exist yet. It also validates the addition, removal and order changes for journalized datastores.
Dropping the journals deletes the entire journalizing infrastructure.
Now to see if the data changes are captured, open the data for the table and change some values as shown below
To see the change journal, select the change capture and journal data. Here you can see that the changes to the table is captured.
More articles for CDC is to be followed
Thanks,
Sandeep
0 comments:
Post a Comment