Data Distribution Topology Data Replication using Admin Client Commands

Create a Broadcast Topology Based Data Replication Using Admin Client Commands

Copy and use the following OBEY script to set up Oracle GoldenGate data replication environment on a pre-installed database.

Note:

The given sample script uses names and values of database server, parameter values, Extract, Replicat, and other processes. You must change these values according to your environment for this script to work.
--
-- Connect the GoldenGate Deployment depl_north
--
CONNECT https://north:9001 DEPLOYMENT depl_north AS ggma PASSWORD GGma_23ai !

ALTER CREDENTIALSTORE ADD USER ggadmin@dbnorth ALIAS ggnorth DOMAIN OracleGoldenGate PASSWORD ggadmin
INFO CREDENTIALSTORE
DBLOGIN USERIDALIAS ggnorth DOMAIN OracleGoldenGate
ADD SCHEMATRANDATA hr
ADD HEARTBEATTABLE

ADD EXTRACT extn INTEGRATED TRANLOG BEGIN NOW
REGISTER EXTRACT extn database
ADD EXTTRAIL north/ea, EXTRACT extn
START EXTRACT extn

ADD DISTPATH dpns_a SOURCE trail://north:9002/services/v2/sources?trail=north/ea TARGET wss://south:9103/services/v2/targets?trail=north/da !
ADD DISTPATH dpns_b SOURCE trail://north:9002/services/v2/sources?trail=north/ea TARGET wss://south:9103/services/v2/targets?trail=north/db !
ADD DISTPATH dpnw_a SOURCE trail://north:9002/services/v2/sources?trail=north/ea TARGET wss://west:9203/services/v2/targets?trail=north/da  !
ADD DISTPATH dpnw_b SOURCE trail://north:9002/services/v2/sources?trail=north/ea TARGET wss://west:9203/services/v2/targets?trail=north/db  !

START DISTPATH dpns_a
START DISTPATH dpns_b
START DISTPATH dpnw_a
START DISTPATH dpnw_b

DISCONNECT
After creating the OBEY file, create a shell script to run in Admin Client. This script runs triggers the bidirectional replication setup using the .oby file:
#!/bin/bash

# Clean up environment 
/home/oracle/scripts/misc/cleanup.sh > /dev/null

# Copy parameter file (usually edited with EDIT PARAMs)
cp EXTN.prm  /u01/app/oracle/deployments/depl_north/etc/conf/ogg/

# Run the GoldenGate Obey script
echo "obey add_replication_datadistribution.oby" | adminclient

Check the Statistics in a Broadcast Topology Based Data Replication Using Admin Client Commands

Note:

The given sample script uses names and values of database server, parameter values, Extract, Replicat, and other processes. You must change these values according to your environment for this script to work.
--
-- Connect the GoldenGate Deployment depl_north
--
CONNECT https://north:9001 DEPLOYMENT depl_north AS ggma PASSWORD GGma_23ai !

INFO  EXTRACT extn
SEND  EXTRACT extn, GETLAG
STATS EXTRACT extn, TOTAL, TOTALSONLY *.*

INFO DISTPATH ALL
STATS DISTPATH dpns_a
STATS DISTPATH dpns_b
STATS DISTPATH dpnw_a
STATS DISTPATH dpnw_b
After creating the OBEY file, create a shell script to run in Admin Client:
echo "obey check_replication_datadistribution.oby" | adminclient

ls -ltrR /u01/app/oracle/deployments/depl_north/var/lib/data/north/
ls -ltrR /u01/app/oracle/deployments/depl_south/var/lib/data/north/
ls -ltrR /u01/app/oracle/deployments/depl_west/var/lib/data/north/

Remove the Broadcast Topology Setup Using Admin Client Commands

Note:

The given sample script uses names and values of database server, parameter values, Extract, Replicat, and other processes. You must change these values according to your environment for this script to work.
-- Connect the GoldenGate Deployment depl_north
--

CONNECT https://north:9001 DEPLOYMENT depl_north AS ggma PASSWORD GGma_23ai !

DBLOGIN USERIDALIAS ggnorth DOMAIN OracleGoldenGate
KILL EXTRACT extn
DELETE  EXTRACT extn

INFO ALL

STOP DISTPATH dpns_a
STOP DISTPATH dpns_b
STOP DISTPATH dpnw_a
STOP DISTPATH dpnw_b

DELETE DISTPATH dpns_a
DELETE DISTPATH dpns_b
DELETE DISTPATH dpnw_a
DELETE DISTPATH dpnw_b

INFO DISTPATH ALL

ALTER CREDENTIALSTORE DELETE USER ggadmin@dbnorth ALIAS ggnorth DOMAIN OracleGoldenGate
INFO CREDENTIALSTORE

PURGE EXTTRAIL north/ea

--
-- Connect the GoldenGate Deployment depl_south
--
CONNECT https://south:9101 DEPLOYMENT depl_south AS ggma PASSWORD GGma_23ai !

PURGE EXTTRAIL north/da
PURGE EXTTRAIL north/db
After creating the OBEY file, create a shell script to run in Admin Client:
#!/bin/bash

# Run the GoldenGate Obey script
echo "obey delete_replication_datadistribution.oby" | adminclient

ls -ltrR /u01/app/oracle/deployments/depl_north/var/lib/data/north/
ls -ltrR /u01/app/oracle/deployments/depl_south/var/lib/data/north/
ls -ltrR /u01/app/oracle/deployments/depl_west/var/lib/data/north/

# Clean up environment
/home/oracle/scripts/misc/cleanup.sh > /dev/null