Change data can be generated at any time, so new changes need to be kept in sync. There are two ways to accomplish this task.
- The first approach can be achieved through planning. For example, create a schedule that performs a synchronization interface every half hour. This can synchronize the change data to the target every half hour. This method requires attention to the scheduled repetition interval, to ensure that the last call has been completed before repeated calls, and can generally be used for periodic synchronization requirements.
- The second approach is to create a package that uses the CDC-related tools provided by ODI to poll the journal and invoke the synchronization interface once a change has been made. This method can meet the demand of high real-time. 1. Create the Package
Designer->projects-> "project name"->first Folder->packages, right click to select "New package", define a name such as:
2. Set Diagram 2.1 odiwaitforlogdataAdd a tool for CDC in the diagram: Odiwaitforlogdata, as shown in the properties:
The Web_customer property is configured to poll the journal table every 1 seconds until 1 changes are found.
2.2 Adding mappingsDrag the map to the right of the diagram, as shown in the properties:
2.2 OdisleepAdd a tool for CDC in the diagram: Odisleep, with the following properties:
Wait 1 seconds to continue polling.
3. Implementation PackageAfter performing the package operation, it will be found that the package is always executing and is in the odiwaiteforlogdata step, such as:
The source table inserts data, SQL such as:
In operator, you will find that the data synchronization is complete and go to the next poll:
Of course, if you delete or update a piece of data in the source table, the target table is also deleted or updated synchronously.
Using Oracle Data Integrator Open Tools