You are on page 1of 3

1/10/2014 Timestamp-Based CDC - Enterprise Information Management - SCN Wiki

Getting Started New sletters Store

Welcome, Guest Login Register Search the Community

Products Services & Support About SCN Downloads

Industries Training & Education Partnership Developer Center

Lines of Business University Alliances Events & Webinars Innovation

Enterprise Information Management / / RDBMS - Source-Based Change Data Capture (CDC)

Timestamp-Based CDC
Added by Brandon Jacobson, last edited by Brandon Jacobson on Feb 29, 2012

If youre using an RDBMS other than Microsoft SQL Server or Oracle (version prior to 9i) for your SAP Business Suite system, you can consider using timestamp based CDC. Please have a look at the
Using CDC w ith timestamp-based sources section of the SAP BusinessObjects Data Services Designer Guide for guidelines as to w hen and w hen not to use this method as w ell as step by step detailed
instructions on how to implement this method.

As you w ill see in the designer guide, there are many possible implementations of a timestamp-based CDC solution depending on w hat types of timestamps are available in the source tables.

Here are the steps to perform a simple extraction from tables that contain create and update timestamp columns.

1. Create a Datastore for the source system.

2. Import the source table(s)

3. Create metadata in HANA.

4. Create a Datastore for HANA.

5. Import the target table(s).

6. Create a Batch Job.

7. Create a Workflow and add it to the Batch Job.

8. Create a script that reads a field from a status table containing a timestamp of w hen the job w as last executed.

$G_LAST_TIMESTAMP = sql(DS_STATUS, SELECT Last_Timestamp FROM dbo.status_table);

9. Create a Dataflow to extract new records and connect it to the first script.

10. Create a Dataflow to extract updated records and connect it to the first Dataflow

11. Create a script that updates the status table and connect it to the second Dataflow .

sql(DS_STATUS, UPDATE dbo.status_table SET Last_Timestamp = SELECT MAX(Update_Timestamp) FROM target_table);

The resulting Workflow should look something like this

12. Open the first Dataflow

13. Add the source table(s) to the Dataflow .

14. Add a Query transform to the Dataflow and connect it to the source table.

15. Add a Map_CDC_Operation transform to the Dataflow and connect it to the Query transform.

16. Open the Query transform.

17. Create the follow ing columns in the target schema

A sequence column of type int w ith the follow ing mapping


gen_row _num()
An operation column of type varchar(1) w ith the follow ing mapping
'I'

18. Map any columns from the source table(s) you w ant to extract.

19. Click on the Where tab

source_table.create_timestamp > $G_LAST_TIMESTAMP.

20. Click on the Order By tab

http://wiki.scn.sap.com/wiki/display/EIM/Timestamp-Based+CDC 1/3
1/10/2014 Timestamp-Based CDC - Enterprise Information Management - SCN Wiki
source_table.create_timestamp.

21. Add the target table to the Dataflow .

22. Connect the Map_CDC_Operation transform to the target table.

23. Open the Map_CDC_Operation transform and configure the CDC columns.

The resulting Dataflow should look something like this

24. Open the second Dataflow

25. Add the source table(s) to the Dataflow .

26. Add a Query transform to the Dataflow and connect it to the source table.

27. Add a Map_CDC_Operation transform to the Dataflow and connect it to the Query transform.

28. Open the Query transform

29. Create the follow ing columns in the target schema

A sequence column of type int w ith the follow ing mapping


gen_row _num()
An operation column of type varchar(1) w ith the follow ing mapping
'U'

30. Map any columns from the source table(s) you w ant to extract.

31. Click on the Where tab

source_table.update_timestamp > $G_LAST_TIMESTAMP.

32. Click on the Order By tab

source_table.update_timestamp.

33. Add the target table to the Dataflow .

34. Connect the Map_CDC_Operation transform to the target table.

35. Open the Map_CDC_Operation transform and configure the CDC columns.

The resulting Dataflow should look something like this

http://wiki.scn.sap.com/wiki/display/EIM/Timestamp-Based+CDC 2/3
1/10/2014 Timestamp-Based CDC - Enterprise Information Management - SCN Wiki

If changes can be made to the source data w hile the job is running, there is a possibility for some changes to be missed. Please have a look at section 20.5.2 Overlaps of the Data Services
Designer Guide for possible solutions to this problem.

No labels

Contact Us SAP Help Portal


Privacy Terms of Use Legal Disclosure Copyright
Follow SCN

http://wiki.scn.sap.com/wiki/display/EIM/Timestamp-Based+CDC 3/3