Translate topic in your language

Thursday, 7 April 2011

Working With Change Data Capture

Changed Data Capture

Purpose of CDC is to enable applications to process changed data only. CDC enables ODI to track changes in source data caused by other applications. When running integration interfaces, ODI can avoid processing unchanged data in the flow. Loads will process only changes since the last load. The volume of data to be processed is dramatically reduced.

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

CDC Techniques

1)Trigger based:
ODI will create and maintain triggers to keep track of the changes.

2) Logs based: ODI retrieves changes from the database logs (Oracle, AS/400).

3) Time stamp based: Processes written with ODI can filter the data by comparing the time stamp value with the last load time (cannot process deletes)

4) Sequence number: If the records are numbered in sequence, ODI can filter the data based on the last value loaded (cannot process updates and deletes).

Changed Data Capture is performed by journalizing models. Journalizing a model consists of setting up the infrastructure to capture the changes (inserts, updates and deletes) made to the records of this model's datastores.
Oracle Data Integrator supports two journalizing modes:

•Simple Journalizing tracks changes in individual datastores in a model.
•Consistent Set Journalizing tracks changes to a group of the model's datastores, taking into account the referential integrity between these datastores. The group of datastores journalized in this mode is called a Consistent Set.

The Journalizing Components

The journalizing components are:
•Journals: Where changes are recorded. Journals only contain references to the changed records along with the type of changes (insert/update, delete).

•Capture processes: Journalizing captures the changes in the source datastores either by creating triggers on the data tables, or by using database-specific programs to retrieve log data from data server log files.

•Subscribers: CDC uses a publish/subscribe model. Subscribers are entities (applications, integration processes, etc) that use the changes tracked on a datastore or on a consistent set. They subscribe to a model's CDC to have the changes tracked for them. Changes are captured only if there is at least one subscriber to the changes. When all subscribers have consumed the captured changes, these changes are discarded from the journals.

•Journalizing views: Provide access to the changes and the changed data captured. They are used by the user to view the changes captured, and by integration processes to retrieve the changed data.
These components are implemented in the journalizing infrastructure

Setting up Journalizing:

This is the basic process for setting up CDC on an Oracle Data Integrator data model. Each of these steps is described in more detail below.

1.Set the CDC parameters
2.Add the datastores to the CDC
3.For consistent set journalizing, arrange the datastores in order
4.Add subscribers
5.Start the journals

Journalizing Tools:

Oracle Data Integrator provides a set of tools that can be used in journalizing to refresh information on the captured changes or trigger other processes:

•SnpsWaitForData waits for a number of rows in a table or a set of tables.

•SnpsWaitForLogData
waits for a certain number of modifications to occur on a journalized table or a list of journalized tables. This tool calls SnpsRefreshJournalCount to perform the count of new changes captured.

•SnpsWaitForTable waits for a table to be created and populated with a pre-determined number of rows.

•SnpsRetrieveJournalData retrieves the journalized events for a given table list or CDC set for a specified journalizing subscriber. Calling this tool is required if using Database-Specific Processes to load journalizing tables. This tool needs to be used with specific knowledge modules.

•SnpsRefreshJournalCount refreshes the number of rows to consume for a given table list or CDC set for a specified journalizing subscriber.

Implementing Changed Data Capture:

Step:1) Import the appropriate JKM in the project.
Click the Projects tab. Expand the Procedure-Demo > Knowledge Modules node, right-click Journalization (JKM), and select Import Knowledge Modules.



Step:2) In the Models tab, create a new model named Oracle_relational_01. For Technology, enter: Oracle. Select the logical schema Sales_Order. Click the Reverse Engineer tab and set Context to development. Verify the setting, as shown in the following screen. Click the Journalizing tab.



Step: 3) In the Knowledge Module menu, select JKM Oracle Simple. Procedure-Demo, as shown in the following screen. Click the Save to save your model and then close the tab.


Step: 4) Reverse-engineer the model Oracle_Relational_01. Expand this model and verify its structure as follows.


Step: 5) Set up the CDC Infrastructure. You will start the CDC on the EMPLOYEE table in the Oracle_Relational_01 model.

To add the table to CDC, expand the Oracle_Relational_01 model, right-click the EMPLOYEE table, and select Change Data Capture > Add to CDC. Click Yes to confirm.


Step: 6) Click the Refresh icon. The small yellow clock icon is added to the table.


Step: 7)
Right-click the EMPLOYEE table again and select Changed Data Capture > Start Journal.



Step: 8) you use the default subscriber SUNOPSIS. For that reason, you do not have to add another subscriber. Click OK to confirm that your subscriber is SUNOPSIS. In the Information window, click OK again. Wait several seconds, then click Refresh and verify that the tiny clock icon at the EMPLOYEE table is green now. This means that your journal has started properly.


Step: 9) Click the ODI Operator icon to open the Operator. Click Refresh. Select All Executions and verify that the EMPLOYEE session executed successfully.


Step: 10) View the data and the changed data.
In the Designer window, open the Models tab. Right-click the EMPLOYEE datastore and select Data.


Step: 11) Select the row with Employee_Key = 10. Change the value of the NAME2 column to “Symond”. Similarly, select the row with Employee_Key = 15, and then change the value to “jacob”. Save your changes and close the tab.


Step: 12) Right-click the table again and select View Data. Scroll down, and verify that the rows are modified. Close the tab.


To verify that your changed data is captured, right-click EMPLOYEE, and select Change Data Capture > Journal Data. Find the captured changed records in the journal data. Close the tab.



Done !

Saturday, 26 March 2011

Oracle Data Integrator 11g Knowledge Modules Description

RKM Oracle


Reverse-engineers tables, views, columns, primary keys, non unique indexes and foreign keys.


JKM Oracle 10g Consistent (Streams)



Creates the journalizing infrastructure for consistent set journalizing on Oracle 10g tables, using Oracle Streams.


JKM Oracle 11g Consistent (Streams)



Creates the journalizing infrastructure for consistent set journalizing on Oracle 11g tables, using Oracle Streams.


JKM Oracle Consistent



Creates the journalizing infrastructure for consistent set journalizing on Oracle tables using triggers.


JKM Oracle Consistent (Update Date)



Creates the journalizing infrastructure for consistent set journalizing on Oracle tables using triggers based on a Last Update Date column on the source tables.


JKM Oracle Simple



Creates the journalizing infrastructure for simple journalizing on Oracle tables using triggers.


JKM Oracle to Oracle Consistent (OGG)



Creates and manages the ODI CDC framework infrastructure when using Oracle GoldenGate for CDC. See Chapter 26, "Oracle GoldenGate" for more information.


CKM Oracle



Checks data integrity against constraints defined on an Oracle table.


LKM File to Oracle (EXTERNAL TABLE)



Loads data from a file to an Oracle staging area using the EXTERNAL TABLE SQL Command.


LKM File to Oracle (SQLLDR)



Loads data from a file to an Oracle staging area using the SQL*Loader command line utility.


LKM MSSQL to Oracle (BCP SQLLDR)



Loads data from a Microsoft SQL Server to Oracle database (staging area) using the BCP and SQL*Loader utilities.


LKM Oracle BI to Oracle (DBLINK)



Loads data from any Oracle BI physical layer to an Oracle target database using database links. See Chapter 17, "Oracle Business Intelligence Enterprise Edition" for more information.


LKM Oracle to Oracle (DBLINK)



Loads data from an Oracle source database to an Oracle staging area database using database links.


LKM Oracle to Oracle (datapump)



Loads data from an Oracle source database to an Oracle staging area database using external tables in the datapump format.


LKM SQL to Oracle



Loads data from any ANSI SQL-92 source database to an Oracle staging area.


LKM SAP BW to Oracle (SQLLDR)



Loads data from SAP BW systems to an Oracle staging using SQL*Loader utilities. See the Oracle Fusion Middleware Application Adapters Guide for Oracle Data Integrator for more information.


LKM SAP ERP to Oracle (SQLLDR)



Loads data from SAP ERP systems to an Oracle staging using SQL*Loader utilities. See the Oracle Fusion Middleware Application Adapters Guide for Oracle Data Integrator for more information.


IKM Oracle AW Incremental Update



Integrates data in an Oracle target table in incremental update mode and is able to refresh a Cube in an Analytical Workspace. See Chapter 21, "Oracle OLAP" for more information.


IKM Oracle Incremental Update



Integrates data in an Oracle target table in incremental update mode.


IKM Oracle Incremental Update (MERGE)



Integrates data in an Oracle target table in incremental update mode, using a MERGE statement.


IKM Oracle Incremental Update (PL SQL)



Integrates data in an Oracle target table in incremental update mode using PL/SQL.


IKM Oracle Multi Table Insert



Integrates data from one source into one or many Oracle target tables in append mode, using a multi-table insert statement (MTI).


IKM Oracle Slowly Changing Dimension



Integrates data in an Oracle target table used as a Type II Slowly Changing Dimension.


IKM Oracle Spatial Incremental Update



Integrates data into an Oracle (9i or above) target table in incremental update mode using the MERGE DML statement. This module supports the SDO_GEOMETRY datatype.


IKM Oracle to Oracle Control Append (DBLINK)



Integrates data from one Oracle instance into an Oracle target table on another Oracle instance in control append mode.


This IKM is typically used for ETL configurations: source and target tables are on different Oracle instances and the interface's staging area is set to the logical schema of the source tables or a third schema.


SKM Oracle



Generates data access Web services for Oracle databases. See "Working with Data Services" in the Oracle Fusion Middleware Developer's Guide for Oracle Data Integrator for information about how to use this SKM.

Extracting Hyperion Financial Management Metadata to Oracle Data Integrator

Step: 1) Go to Start--->Program Files--->Oracle--->Oracle Data Integrator explore ODI and login to work repository.


Step: 2) After successfully login to work repository go to Topology Navigator select Physical Architecture Tab and select Technology and expand it. Go to the Hyperion Financial Management Right Click and select ‘New Data Server’.


Step: 3) In the definition tab enter the following details as shown in the picture below:
Name: Appropriate name to data server
Cluster (Data Server): System name
User: User Name
Password: password


Step: 4) Click on Save it will ask you to create physical schema press ‘OK’.


Step: 5) In Technology Tab go to Hyperion Financial Management expand it and select newly create data server Right Click and select ‘New Physical schema’.


Step: 6) In the definition tab enter the HFM Application name to which you want to connect.


Step: 7) Click on Save it will ask you to specify the context press ‘OK’.


Step: 8) Go to the Logical Architecture tab Expand Technologies and select Hyperion Financial Management Right-click and select ‘New Logical Schema’.


Step: 9) Give appropriate name to logical schema and set the Context to Hyperion Financial Management physical schema.


Step: 10) Click on ‘Save’.

Step: 11) Go to the ODI Designer and create new Project with appropriate name.



Step: 12) Click on ‘Save’. You can check in the project tab


Step: 13) Expand project go to knowledge module right click and import following knowledge modules.



RKM Hyperion Financial Management
LKM File to SQL
LKM Hyperion Financial Management Members To SQL
LKM Hyperion Financial Management Data To SQL
IKM SQL to Hyperion Financial Management Data
IKM SQL to Hyperion Financial Management Dimension
IKM SQL to File Append

Step: 14) Press Ctrl and select all three knowledge





Step: 15) ‘Close’.


Step: 16) Now go to the model tab and create new model folder.


Step: 17) Go to the model tab and create new model.


Step:18) Go to the Reverse Engineer tab select customize check box and enter details as follows:


Step: 19) ‘Save’

Step:20) Newly created Model will be available for Reverse Engineering go to Model tab select Hyperion planning model and Right Click and select Reverse Engineers. Before Reverse Engineer the models make sure your agent services are running if not start it with following command:

C:\oracle\Middleware\Oracle_ODI1\oracledi\agent\bin>agent –NAME=localagent


Step: 21) Now you can reverse engineer it.



Press ‘OK’.


Step: 22) Go to the Operator Tab check whether the Execution run successfully or not.


If all the checks are green that means your model reversed successfully.

Step: 23) Go to the Designer and open model tab expand Hyperion Financial Management model again. You can check all the dimensions are visible there from your HFM application


Done !