OBEY
Scripts are available in cURL and as OBEY commands to be run in Admin Client, to
test the business reporting scenario. You can use the scripts available in the following
topics to:
-
Add a data replication environment and view the processes that are created after the scripts runs successfully.
-
Check the statistical reports for Daily, Hourly, and Total committed DML and DDL operations.
-
Delete the data replication environment and verify that the environment was deleted after testing.
Set Up a Data Replication Environment Using OBEY Files
Copy and use the following OBEY script to set up Oracle GoldenGate data
replication environment on an 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 xxxxxx !
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 SOURCE trail://north:9002/services/v2/sources?trail=north/ea TARGET wss://south:9103/services/v2/targets?trail=north/da !
START DISTPATH dpns
--
-- Connect the GoldenGate Deployment depl_south
--
CONNECT https://south:9101 DEPLOYMENT depl_south AS ggma PASSWORD xxxxxx !
ALTER CREDENTIALSTORE ADD USER ggadmin@dbsouth ALIAS ggsouth DOMAIN OracleGoldenGate PASSWORD ggadmin
INFO CREDENTIALSTORE
DBLOGIN USERIDALIAS ggsouth DOMAIN OracleGoldenGate
ADD CHECKPOINTTABLE ggadmin.ggs_checkpointtable
ADD HEARTBEATTABLE
ADD REPLICAT repn, PARALLEL, EXTTRAIL north/da, CHECKPOINTTABLE ggadmin.ggs_checkpointtable
START REPLICAT repn
INFO ALL
INFO DISTPATH ALL
DISCONNECT
After creating the OBEY file, create a shell script to run in Admin
Client:
cp EXTN.prm /u01/app/oracle/deployments/depl_north/etc/conf/ogg/
cp REPN.prm /u01/app/oracle/deployments/depl_south/etc/conf/ogg/
echo "obey add_replication_reporting.oby" | adminclient
Check the Statistical Reports Using OBEY Files
Copy and use the following OBEY script by adjusting the values for each of the
options with the options in your enviornment, to check the statistical data for the
DDL and DML operations.
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 DPNS
STATS DISTPATH DPNS
--
-- Connect the GoldenGate Deployment depl_south
--
CONNECT https://south:9101 DEPLOYMENT depl_south AS ggma PASSWORD GGma_23ai !
INFO REPLICAT repn
SEND REPLICAT repn, GETLAG
STATS REPLICAT repn, TOTAL, TOTALSONLY *.*
DISCONNECT
After you create the preceding .oby file, create a shell script to run in Admin
Client that would run the .oby
commands:
echo "obey check_replication_reporting.oby" | adminclient
Delete the Replication Environment Using OBEY Files
Copy and use the following OBEY script by adjusting the values for each of the
options with the options in your enviornment, to delete the data replication
environment.
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_south
--
CONNECT https://south:9101 DEPLOYMENT depl_south AS ggma PASSWORD GGma_23ai !
DBLOGIN USERIDALIAS ggsouth DOMAIN OracleGoldenGate
KILL REPLICAT repn
DELETE REPLICAT repn
DELETE CHECKPOINTTABLE ggadmin.ggs_checkpointtable !
DELETE HEARTBEATTABLE !
ALTER CREDENTIALSTORE DELETE USER ggadmin@dbsouth ALIAS ggsouth DOMAIN OracleGoldenGate
INFO CREDENTIALSTORE
PURGE EXTTRAIL north/da
-- Connect the GoldenGate Deployment depl_north
--
CONNECT https://north:9001 DEPLOYMENT depl_north AS ggma PASSWORD GGma_23ai !
STOP DISTPATH dpns
DELETE DISTPATH dpns
DBLOGIN USERIDALIAS ggnorth DOMAIN OracleGoldenGate
KILL EXTRACT extn
DELETE EXTRACT extn
INFO ALL
INFO DISTPATH ALL
ALTER CREDENTIALSTORE DELETE USER ggadmin@dbnorth ALIAS ggnorth DOMAIN OracleGoldenGate
INFO CREDENTIALSTORE
PURGE EXTTRAIL north/ea
DISCONNECT
After you create the preceding .oby file, create a shell script to run in Admin Client that would run the .oby commands:
rm -f /u01/app/oracle/deployments/depl_north/etc/conf/ogg/EXTN.prm
rm -f /u01/app/oracle/deployments/depl_south/etc/conf/ogg/REPN.prm
echo "obey delete_replication_reporting.oby" | adminclient