Thinking Out Loud

February 12, 2012

My Bi-directional Replication Using GoldenGate Adventure, Ep3

Filed under: 11g,GoldenGate,oracle — mdinh @ 4:24 am

GG Server: goldengate01, goldengate02

DB Server: ha01 (goldengate01), ha02(goldengate02)

CONFIGURATION at goldengate01:

CREATE PRIMARY EXTRACT:

Extract starts with x and is named after the database instance.

Extract xha01 writes to trail file (xa) locally on the server.

— Primary Extract to local trail xa
ADD EXTRACT xha01, TRANLOG, BEGIN NOW
ADD EXTTRAIL /u01/app/ggs/dirdat/xa, EXTRACT xha01, MEGABYTES 500

CREATE DATAPUMP EXTRACT:

DataPump Extract starts with p and is named after the database instance.

DataPump Extract pha01 reads from Primary Extract trail file (xa) locally on the server.

DataPump Extract pha01 sends trail file (pa) to REMOTE SERVER (goldengate02).

— DataPump Extract reads from local trail xa; pump to remote trail pa
ADD EXTRACT pha01, EXTTRAILSOURCE /u01/app/ggs/dirdat/xa
ADD RMTTRAIL /u01/app/ggs/dirdat/pa, EXTRACT pha01, MEGABYTES 500

CREATE REPLICAT:

Replicat starts with r and is named after the database instance.

Replicat rha01 reads from trail (pb), received from REMOTE SERVER (goldengate02)

— Replicat reads from datapump trail pb from pha02
ADD REPLICAT rha01, EXTTRAIL /u01/app/ggs/dirdat/pb

CONFIGURATION at goldengate02:

— Primary Extract to local trail xb
ADD EXTRACT xha02, TRANLOG, BEGIN NOW
ADD EXTTRAIL /u01/app/ggs/dirdat/xb, EXTRACT xha02, MEGABYTES 500

— DataPump Extract reads from local trail xb; pump to remote trail pb
ADD EXTRACT pha02, EXTTRAILSOURCE /u01/app/ggs/dirdat/xb
ADD RMTTRAIL /u01/app/ggs/dirdat/pb, EXTRACT pha02, MEGABYTES 500

— Replicat reads from datapump trail pb from pha01
ADD REPLICAT rha02, EXTTRAIL /u01/app/ggs/dirdat/pa

CREATE obey script to CONFIGURE both GG Servers:

oracle@goldengate01:ha01:/u01/app/ggs
> cat config_ha01.obey
dblogin userid gguser, password AACAAAAAAAAAAAJAXHHGIEDCVGTJXDDEPHZEFEMDPEEGEJMH, encryptkey key1
allownested
versions
-- Primary Extract to local trail xa
ADD EXTRACT xha01, TRANLOG, BEGIN NOW
ADD EXTTRAIL /u01/app/ggs/dirdat/xa, EXTRACT xha01, MEGABYTES 500
-- DataPump Extract reads from local trail xa; pump to remote trail pa
ADD EXTRACT pha01, EXTTRAILSOURCE /u01/app/ggs/dirdat/xa
ADD RMTTRAIL /u01/app/ggs/dirdat/pa, EXTRACT pha01, MEGABYTES 500
-- Replicat reads from datapump trail pb from pha02
ADD REPLICAT rha01, EXTTRAIL /u01/app/ggs/dirdat/pb
oracle@goldengate02:ha02:/u01/app/ggs
> cat config_ha02.obey
dblogin userid gguser, pbssword AACAAAAAAAAAAAJAXHHGIEDCVGTJXDDEPHZEFEMDPEEGEJMH, encryptkey key1
allownested
versions
-- Primary Extract to local trail xb
ADD EXTRACT xha02, TRANLOG, BEGIN NOW
ADD EXTTRAIL /u01/app/ggs/dirdat/xb, EXTRACT xha02, MEGABYTES 500
-- DataPump Extract reads from local trail xb; pump to remote trail pb
ADD EXTRACT pha02, EXTTRAILSOURCE /u01/app/ggs/dirdat/xb
ADD RMTTRAIL /u01/app/ggs/dirdat/pb, EXTRACT pha02, MEGABYTES 500
-- Replicat reads from datapump trail pb from pha01
ADD REPLICAT rha02, EXTTRAIL /u01/app/ggs/dirdat/pa

EXECUTE obey script at both GG Servers:

Here is an example for the execute at goldengate01

oracle@goldengate01:ha01:/u01/app/ggs
> ggsci < config_ha01.obey
Oracle GoldenGate Command Interpreter for Oracle
Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
Solaris, x64, 64bit (optimized), Oracle 11g on Oct 4 2011 23:54:06
Copyright (C) 1995, 2011, Oracle and/or its affiliates. All rights reserved.
GGSCI (goldengate01) 1> Successfully logged into database.
GGSCI (goldengate01) 2> Nested OBEY scripts allowed.
GGSCI (goldengate01) 3> Operating System:
SunOS
Version Generic_141445-09, Release 5.10
Node: goldengate01
Machine: i86pc
Database:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
PL/SQL Release 11.2.0.3.0 - Production
CORE 11.2.0.3.0 Production
TNS for Solaris: Version 11.2.0.3.0 - Production
NLSRTL Version 11.2.0.3.0 - Production
GGSCI (goldengate01) 4>
GGSCI (goldengate01) 5> EXTRACT added.
GGSCI (goldengate01) 6> EXTTRAIL added.
GGSCI (goldengate01) 7>
GGSCI (goldengate01) 8> EXTRACT added.
GGSCI (goldengate01) 9> RMTTRAIL added.
GGSCI (goldengate01) 10>
GGSCI (goldengate01) 11> REPLICAT added.
GGSCI (goldengate01) 12>
oracle@goldengate01:ha01:/u01/app/ggs

Create checkpoint table at both GG Server:

Here’s the obey script

> cat add_checkpointtable.obey
dblogin userid gguser, password AACAAAAAAAAAAAJAXHHGIEDCVGTJXDDEPHZEFEMDPEEGEJMH, encryptkey key1
add checkpointtable
info checkpointtable
exit
Advertisements

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: