Setting up a GoldenGate replication between Oracle RAC databases
High Availability is the buzz word in today's world. The systems need to be available all the time. The applications store their data in the databases, so it becomes quite critical for the databases to be fault tolerant and always available. Oracle RAC is a popular choice when companies want to build resilience in their systems. More and more applications are becoming RAC aware and it is quite common to see companies migrating most of their applications to Oracle RAC-based database environments.
Replicating the data between Oracle RAC databases requires some additional setup. In this recipe we will look into what configuration steps are required to setup replication between Oracle RAC environments. We will not cover the set up required to make the GoldenGate replication highly available itself as there are many ways to do it and will be covered in separate recipes in Chapter 5, Oracle GoldenGate High Availability.
Getting ready
This recipe assumes that GoldenGate has already been installed in the source and target environment. Both the source and target databases are 2 Node Oracle RAC 11.2.0.3 databases. In both environments, GoldenGate has been installed in a shared filesystem /u01
.
How to do it…
Perform the following steps in the source database:
- Create an Extract process
EGGTEST1
in the source environment:./ggsci EXTRACT EGGTEST1 USERID GGATE_ADMIN@RACDB, PASSWORD GGATE_ADMIN TRANSLOGOPTIONS DBLOGREADER EXTTRAIL /u01/app/ggate/dirdat/st TABLE scott.*;
- Create a GoldenGate Datapump process in the source environment:
./ggsci EDIT PARAMS PGGTEST1 EXTRACT PGGTEST1 USERID GGATE_ADMIN@RACDB, PASSWORD GGATE_ADMIN RMTHOST tg-oggvip.localdomain , MGRPORT 8809 RMTTRAIL /u01/app/ggate/dirdat/rt TABLE scott.*;
- Add the Extract process to the source manager configuration:
ADD EXTRACT EGGTEST1, THREADS 2, TRANLOG, BEGIN NOW
- Add the local trail to the Extract process:
ADD EXTTRAIL /u01/app/ggate/dirdat/st, EXTRACT EGGTEST1, MEGABYTES 100
- Add the Datapump process to the source manager configuration:
ADD EXTRACT PGGTEST1, EXTTRAILSOURCE /u01/app/ggate/dirdat/st
- Add the remote trail location to the Datapump process:
ADD RMTTRAIL /u01/app/ggate/dirdat/rt, EXTRACT PGGTEST1, MEGABYTES 100
- Start the Extract and Datapump process:
START EXTRACT EGGTEST1 START EXTRACT PGGTEST1
Perform the following steps in the target database:
- Create a GoldenGate Replicat process in the target environment:
./ggsci EDIT PARAMS RGGTEST1 REPLICAT RGGTEST1 USERID GGATE_ADMIN@TGRACDB, PASSWORD GGATE_ADMIN DISCARDFILE /u01/app/ggate/dirrpt/RGGTEST1.dsc,append,MEGABYTES 500 ASSUMETARGETDEFS MAP SCOTT.*, TARGET SCOTT.*;
- Add the Replicat process to the target manager configuration:
ADD REPLICAT RGGTEST1, EXTTRAIL /u01/app/ggate/dirdat/rt,CHECKPOINTTABLE CHECKPOINT, BEGIN NOW
- Start the Replicat process:
START REPLICAT RGGTEST1
How it works…
The setup assumes that Oracle GoldenGate is already installed in the source and target environment, and a GoldenGate manager instance has been set up as well. We create an extract parameter file. Since this database is running on Oracle ASM, we need to specify the TRANSLOGOPTIONS DBLOGREADER
parameter to enable the Extract process to read the archive log from ASM. We then create a Datapump process parameter file. The key thing to note in the Datapump configuration in the case of the Oracle RAC-based target system is the name of the remote host. The GoldenGate manager resource should be configured on a Virtual IP in the target environment and this Virtual IP should be specified as the remote host in the source Datapump configuration.
In an RAC environment, you need to specify the threads parameter while adding the Extract process to the GoldenGate manager configuration.
The TNS entry used in the replicat configuration should be configured using the TAF policies in your environment.
You can also use GoldenGate to set up replication between two environments when only one of them is clustered.
See also
For information on how to configure GoldenGate in an RAC environment see the following receipes in Chapter 5, Oracle GoldenGate High Availability:
- Creating a highly available GoldenGate configuration using Oracle Clusterware and ACFS
- Creating a highly available GoldenGate configuration using Oracle Clusterware and OCFS2
- Creating a highly available GoldenGate configuration using Oracle Clusterware and DBFS