ODIExperts.com

The blog for Oracle Data Integrator ( ODI )

Subscribers – An example of how to use

Hi friends,

I was helping in a thread at ODI Forum, from Oracle page (http://forums.oracle.com/forums/forum.jspa?forumID=374) and I decided to describe the situation here once several people ask me similar questions

What is a Subscriber and how to use it?

  • A subscriber is a way to get the same data, from the same source, to more than one target (or process) when in CDC (Change Data Capture) mode.

I will try to demonstrate it by an example:

Situation:

  •  In a generic system, when a new client is created it is necessary to upload into a DW and send a welcome email to him.
  •  The email should be send, at top, one hour after the insert
  •  The DW load happens once a day, by midnight.

As you see, these are very distinct process. To solve it using subscribers we could do:

  1. Add the Client table to the CDC (I’m using the Simple mode here)
  2. Add 2 subscribers in the table, I named them sb_EMAIL and sb_DW
  3. Start the Journal process

Ok, now we have the environment ready to both process, load to DW and send the email

If you take a look into the journal table (J$_) after insert a new record at Client, you will see 2 records at the view, one to each subscriber and that allows you to execute distinct process to the same source DML.

In this example, to send the email an interface is used to put the new client in a table (another system is responsible to send it) then all that is necessary to be done is:

  • In the interface, check the “Journalized Data Only” and edit the filter to the subscriber “sb_EMAIL”
  • create the scenario for the interface
  • schedule it to execute once by hour at the minute 59 (like: 10:59 am, 11:59 am,  etc)

And,   to the DW load process:

  • In the interface, check the “Journalized Data Only” and edit the filter to the subscriber “sb_DW”
  • create the scenario for the interface
  • schedule it to execute once by day (midnight)

 

That is all! If you query the J$_ table near to 11:00 pm you will see all clients that were inserted  during the day with the subscriber “sb_DW” and only the clients inserted after 10:59 pm.

One last point:

if the situation doesn’t need to send the same data to more than one target, just one subscriber can be used to infinite tables.

 

Well guys, I hope to have reached the objective the explain how a subscriber can be used!!

 

Cezar Santos

7 Comments

Leave a Reply

Required fields are marked *.


This site uses Akismet to reduce spam. Learn how your comment data is processed.