The Journalizing Components Introduction to Changed Data Capture

7-4 Oracle Fusion Middleware Developers Guide for Oracle Data Integrator 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. To set the datastores order:

1. In the Models tree in the Designer Navigator, select the model journalized in

consistent set mode. 2. Double-click this model to edit it.

3. Go to the Journalized Tables tab.

4. If the datastores are not currently in any particular order, click the Reorganize

button. This feature suggests an order for the journalized datastores based on the foreign keys defined in the model. Review the order suggested and edit the datastores order if needed. 5. Select a datastore from the list, then use the Up and Down buttons to move it within the list. You can also directly edit the Order value for this datastore. 6. Repeat the previous step until the datastores are ordered correctly.

7. From the File menu, select Save All.

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: Note: 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. Note: Changes to the order of datastores are taken into account the next time the journals are restarted. If existing scenarios consume changes from this CDC set, you should regenerate them to take into account the new organization of the CDC set. Working with Changed Data Capture 7-5

1. 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.

2. Right-click, then select Changed Data Capture Subscriber Subscribe. A

window appears which lets you select your subscribers.

3. Type a Subscriber name, then click the Add Subscriber button. Repeat the

operation for each subscriber you want to add. 4. Click OK.

5. In the Execution window, select the execution parameters:

■ Select the Context into which the subscribed must be registered. ■ Select the Logical Agent that will run the journalizing tasks. 6. Click OK. 7. The Session Started Window appears. 8. Click OK. You can review the journalizing tasks in the Operator Navigator. Removing a subscriber is a similar process. Select the Changed Data Capture Subscriber Unsubscribe option instead. You can also add subscribers after starting the journals. Subscribers added after journal startup will only retrieve changes captured since they were added to the subscribers list. StartDrop 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. To start or drop the journals:

1. 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.

2. Right-click, then select Changed Data Capture Start Journal if you want to start

the journals, or Changed Data Capture Drop Journal if you want to stop them. 3. In the Execution window, select the execution parameters: ■ Select the Context into which the journals must be started or dropped. ■ Select the Logical Agent that will run the journalizing tasks. Note: Subscriber names cannot contain single quote characters. Note: Dropping the journals deletes all captured changes as well as the infrastructure. For simple journalizing, starting the journal in addition deletes the journal contents. Consistent Set JKMs support restarting the journals without losing any data.