Skip to Main Content
  • Questions
  • Change Data Capture to get modified records of a table

Breadcrumb

May 4th

Question and Answer

Connor McDonald

Thanks for the question, Praveen.

Asked: October 17, 2016 - 6:45 pm UTC

Last updated: October 18, 2016 - 3:27 am UTC

Version: Oracle 11g

Viewed 1000+ times

You Asked

Hello Tom,

Hope you are doing good!

Request your suggestions for the following scenario.

We have a requirement wherein we have to migrate modified/delta data on a table(Modified by DML statements) from Oracle to MongoDb. To do this i have suggested to create Trigger on intended table and insert the Updated/Inserted/Deleted records into logging table and using Java code we will be able to read these modified/delta records and then update the respective collections in MongoDB.

But I have been asked to check the feasibility of Oracle's CDC(Change Data Capture) feature.

I have checked Oracle doc to learn CDC but it takes quite a time. Could you please help me with some steps or any quick tutorial to implement CDC to capture modified data on a table and hoe to use the modified records as i have to create a demo asap.

Also please suggest which will be better from performance point of view to log modified/delta records using trigger or CDC.

Thank you. Good day!

and Connor said...

From a strategic perspective, I would suggest you would be far better off using Goldengate to replicate from Oracle to Mongo.

Here's a blog post from Pythian with a full demo

https://www.pythian.com/blog/goldengate-12-2-big-data-adapters-part-5-mongodb/

Using CDC, triggers or AQ could all be done - but that's a lot of manual setup and maintenance effort. If you really want to head down the path, you could follow one of the many streams demos on the 'net, eg

http://psoug.org/reference/streams_demo2.html

In that demo, your "update_salary_history" procedure would basically construct a JSON payload for transmission into MongoDB.

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Thanks for the valuable suggestions

Praveen, October 18, 2016 - 7:13 am UTC

Hello Connor McDonald,

Thank you for the valuable suggestions on easy CDC resources. I shall go through the steps and ask you in case of any doubts.

More to Explore

PL/SQL demos

Check out more PL/SQL tutorials on our LiveSQL tool.

PL/SQL docs

PL/SQL reference manual from the Oracle documentation library