Mapping the changes to a target table and storing the transaction history in a history table
Many businesses, these days, have a requirement to keep a transaction history of the data. This could be due to regulatory requirements or even for management reporting. Oracle GoldenGate's flexible architecture allows you to track the old value of a record before a change is applied to it. You can then map these changes to a different table to maintain a transaction history.
In this recipe we will look into how we can track the changes occurring on a source database table and replicate them to a target database table and also maintain the transaction history in a separate table.
Getting ready
For this recipe we will set up a replication between the EMP
table in the SCOTT
demo schema that is delivered in the $ORACLE_HOME/sqlplus/demo/demobld.sql
script by Oracle.
We will also create an additional table in the target environment called EMP_TXN_HISTORY
with the following structure:
EMP_TXN_HISTORY |
---|
EMPNO... |