GoldenGate Bidirectional Replication using TAG

Facebook
Twitter
LinkedIn
Email

GoldenGate Bidirectional Replication Using TAG between two databases

GoldenGate bidirectional replication using tag is a feature that allows to selectively extract and replicate data between two databases in a bi-directional way based on the tags that has been setup and assigned to specific process at transactional level.

Here is an overview on how the Bidirectional GoldenGate works with Tags:

  • Configure GoldenGate instance : 2 Extracts and 2 Replicats configured for source and target databases.

  • Assign first SETTAG to Replicat on Target database
    In this Example : SETTAG 01 is set to REP Y on Target Y Database.

  • Assign EXCLUDETAG to extract on Target Database
    In this Example : EXCLUDETAG 01 on EXT Y from Target Database

  • Assign SETTAG to Replicat on Source database
    In this Example : SETTAG 02 is set to REP X on Source X Database.

  • Assign EXCLUDETAG to extract on Source Database
    In this Example : EXCLUDETAG 02 on EXT X on Source Database

With the above configuration, transactions that have the tag SETTAG 01 associated will be replicated from the source database to the target database. Meanwhile, in the target database transactions associated with the tags are ignored by EXCLUDETAG 01 parameter from the Extract.

Similarly, on Source Database, transactions that have the tag SETTAG 02 associated will be replicated from the target database to the Source database. In the source database transactions associated with the tags are ignored by EXCLUDETAG 02 parameter from the Extract.

Note : GoldenGate bidirectional replication using tags requires careful planning and testing to ensure that it works correctly and doesn’t introduce data conflicts. This approach doesn’t use AUTOCDR and application should not modify the same data same time on both the databases.

SAMPLE ARCHITECTURE

GoldenGate Bidirectional Replication Using TAG
GoldenGate Bidirectional Replication Using TAG
Assumptions :

  • Goldengate custom install on VM or either through the use of a marketplace offering or by provisioning it on Oracle Cloud Infrastructure (OCI) are in place and running without any issues.
  • Two Oracle databases provisioned that are currently operational, are connected to GoldenGate and ready for data replication.

SAMPLE PARAMETERS USING TAG

				
					########################################################################
####################### Replicat REP -Y On DATABASE-Y ##################
########################################################################
		replicat REPY
		USERIDALIAS GGSOracle DOMAIN OracleGoldenGate
		DBOPTIONS SETTAG 02
		MAP SOE.*, TARGET SOE.*;

########################################################################
####################### Extract EXT -Y On DATABASE-Y ###################
########################################################################
		extract EXTY
		USERIDALIAS GGSATP DOMAIN OracleGoldenGate
		exttrail /u02/trails/ex
		TRANLOGOPTIONS EXCLUDETAG 02
		TABLESOE.*;

########################################################################
####################### Replicat REP-X On DATABASE-X ###################
########################################################################
		replicat REPX
		USERIDALIAS GGSATP DOMAIN OracleGoldenGate
		DBOPTIONS SETTAG 01
		MAP SOE.*, TARGET SOE.*;
		
########################################################################
####################### Extract EXT-X On DATABASE-X ###################
########################################################################
		extract EXTX
		USERIDALIAS GGSATP DOMAIN OracleGoldenGate
		exttrail /u02/trails/ex
		TRANLOGOPTIONS EXCLUDETAG 01
		TABLE SOE.*;
########################################################################
				
			
Summary of SETTAG and EXCLUDETAG
Overall, the SETTAG and EXCLUDETAG parameter in GoldenGate 12c bidirectional replication provides a way to mark transactions with a unique identifier, that can be used for filtering or conflict resolution purposes and preventing conflicts and maintaining data consistency.
Further Reading - AutoCDR
Bidirectional replication can be further customized using features such as Conflict Detection and Resolution (CDR). Auto CDR is a feature of Oracle GoldenGate that automates the process of detecting and resolving conflicts that may occur during data replication between two databases.

Auto CDR works by comparing the timestamps of transactions in both databases and selecting the transaction with the latest timestamp to apply to the target database. If both transactions have the same timestamp, Auto CDR uses a set of predefined rules to determine which transaction to apply.

By automating the conflict detection and resolution process, Auto CDR reduces the need for manual intervention and improves the efficiency and reliability of data replication in GoldenGate.

If you have an application that simultaneously connect to and modify two databases, then it is recommended to use the Auto CDR feature of Oracle GoldenGate. This feature automates conflict detection and resolution, making it easier to work with both databases concurrently.

You can find the complete official oracle documentation about SETTAG & EXCLUDETAG here.
Hope you found this article useful.
Disclaimer: The views expressed on this document are my own and do not necessarily reflect the views of Oracle..