In this blog, let's discuss how you can create one Oracle GoldenGate extract for multiple targets. The example scenario captures transactions from one Oracle Database and delivers to multiple Big data Repositories (PPT). To void creating additional extracts, you can configure the Oracle GoldenGate extract pump to write to multiple remote trail files.
The extract pump parameter files is shown as follows:
When creating these types of pumps, you need to run add exttrail to add all the additional trail files.
Please also refer to Oracle GoldenGate Architecture: What's possible and what's not? for more Oracle GoldenGate configuration possibilities.
Active-Active replication allows databases actively receive transactions when their data are synchronized by the data replication. The implementation enables you to provide :
Information: Oracle GoldenGate starts to provides built-in conflict detection and resolution routines in 11.2 to support bi-directional and multi-master configurations. (Source: Oracle GoldenGate 11.2 Release Notes)
1. What is Conflict Resolution and Detection (CDR)?
Let's use the following example from the Oracle GoldenGate Administration Guide   to explain what CDR is:
MAP fin.src, TARGET fin.tgt,
COMPARECOLS (ON UPDATE ALLEXCLUDING (comment)),
UPDATEROWEXISTS, (delta_res_method, USEDELTA, COLS (salary, balance)),
(max_res_method, USEMAX (last_mod_time), COLS (address, last_mod_time)),
We can divide the CDR configuration into two parts: the conflict detection and the conflict resolution.
1.1 Conflict Detection
Oracle GoldenGate uses key columns to identity the records and then detects conflicts by comparing the data before and after the transaction updates. You need the following configurations for the conflict detection:
Why do I get the " WARNING OGG-02180 Table xxx.xxx.xxx will use legacy trail format to support parameter UPDATEBEFORES." message?
In Oracle GoldenGate 12.3, you would use LOGALLSUPCOLS instead of GETBEFOREUPDATES. You might get the following error message for all of your tables: "WARNING OGG-02180 Table xxx.xxx.xxx will use legacy trail format to support parameter UPDATEBEFORES. "
1.2. Conflict Resolution
Oracle GoldenGate provides REOLVECONFLICT to defines the resolutions for each conflict. The following is the list of conflicts:
Oracle GoldenGate Conflict Resolution Parameters
In the example, when updating a record with different value on the target database:
Oracle GoldenGate provides detailed reports of all the CDR operations. You can find them from the GGCSI command, report file or column-conversion functions.
Best Practices: Avoid Conflict First and Make Resolution Rule as Simple as Possible
Conflict detection and Resolution operates on each rows of your data. Therefore, it's a significant overhead especially when having millions of row to process. Consequently, you would avoid conflict in the first place by controlling transaction operations in your applications such as using application segregation or using different primary keys in different DBs. Then, you would use the simplest resolution rule such as using a transaction timestamp or relying on trusted sources to overwrite inconsistent data. 
2. CDR Design Strategy
n summary, there are two typical strategies when implementing CDR:
3. Example using Oracle GoldenGate Hub for Active-Active Replication
Let's explain how CDR works with the following example. (PPT)
This example has two databases: DB a and DB b. An Oracle GoldenGate Hub is configured to set up the bidirectional replication. The network latencies between the databases and the Oracle GoldenGate Hub are 2 seconds and 10 seconds respectively. The active-active replication is configured which the resolution rule using the master-slave with overwrite approach, which takes DB b as the master or the trusted source.
Let's look an example processing flow:
Of course, the latency will not be this big in your environment. You should typically see the update instantaneously. Here, I use large latency numbers to help you notice that during the latency period, you will have data inconsistency. Therefore, it's important to handle this at the application layer. I have seen approaches like the following used:
After you configure the replication correctly, you can enjoy the benefits of CDR and active-active replication.
Created 10/11/2017, Last Updated: 2/28/2018