CONFIGURING ONLINE CHANGE SYNCHRONIZATION

                       CONFIGURING ONLINE CHANGE SYNCHRONIZATION

i)In this tutorial, we will see how by using GoldenGate change synchronization,
changes that occur on the source (Oracle 11g on Linux) are applied near real
time on the target (Oracle 11g on AIX). The table on the source is the EMP
table in SCOTT schema which is being replicated to the EMP table in the target
database SH schema.

These are the steps that we will take:

1)Create a GoldenGate Checkpoint table
2)Create an Extract group
3)Create a parameter file for the online Extract group
4)Create a Trail
5)Create a Replicat group
6)Create a parameter file for the online Replicat group
7)Create the GoldenGate Checkpoint table

ii)GoldenGate maintains its own Checkpoints which is a known position in the
trail file from where the Replicat process will start processing after any kind of
error or shutdown. This ensures data integrity and a record of these checkpoints
is either maintained in files stored on disk or table in the database which is the
preferred option.

iii)We can also create a single Checkpoint table which can used by all Replicat
groups from the single or many GoldenGate instances.
In one of the earlier tutorials we had created the GLOBALS file. We now need
to edit that GLOBALS file and add an entry for CHECKPOINTTABLE which

GGSCI (devu007) 2> EDIT PARAMS ./GLOBALS

GGSCI (devu007) 4> DBLOGIN USERID ggs_owner, PASSWORD

GGSCI (devu007) 6> ADD CHECKPOINTTABLE

> sqlplus ggs_owner/ggs_owner

SQL> desc chkptab
Name Null? Type
----------------------------------------- -------- ----------------------------
GROUP_NAME NOT NULL VARCHAR2(8)
GROUP_KEY NOT NULL NUMBER(19)
SEQNO NUMBER(10)
RBA NOT NULL NUMBER(19)
AUDIT_TS VARCHAR2(29)
CREATE_TS NOT NULL DATE
LAST_UPDATE_TS NOT NULL DATE
CURRENT_DIR NOT NULL VARCHAR2(255)

Create the Online Extract Group

GGSCI (redhat346.localdomain) 1> ADD EXTRACT ext1, TRANLOG,

Create the Trail

We now create a trail – note that this path pertains to the GoldenGate software
location on the target system and this is where the trail files will be created
having a prefix ‘rt’ which will be used by the Replicat process also running on
the target system

GGSCI (redhat346.localdomain) 2> ADD
RMTTRAIL /u01/oracle/software/goldengate/dirdat/rt, EXTRACT ext1

Create a parameter file for the online Extract group ext1

GGSCI (redhat346.localdomain) 3> EDIT PARAMS ext1
EXTRACT ext1
USERID ggs_owner, PASSWORD ggs_owner
RMTHOST devu007, MGRPORT 7809
RMTTRAIL /u01/oracle/software/goldengate/dirdat/rt
TABLE scott.emp;

ON TARGET SYSTEM

Create the online Replicat group

GGSCI (devu007) 7> ADD REPLICAT rep1,
EXTTRAIL /u01/oracle/software/goldengate/dirdat/rt
REPLICAT added.
Note that the EXTTRAIL location which is on the target local system conforms
to the RMTTRAIL parameter which we used when we created the parameter
file for the extract process on the source system.

Create a parameter file for the online Replicat group, rep1

GGSCI (devu007) 8> EDIT PARAMS rep1
REPLICAT rep1
ASSUMETARGETDEFS
USERID ggs_owner, PASSWORD ggs_owner
MAP scott.emp, TARGET sh.emp;
ON SOURCE
Start the Extract process

GGSCI (redhat346.localdomain) 16> START EXTRACT ext1
Sending START request to MANAGER …
EXTRACT EXT1 starting

GGSCI (redhat346.localdomain) 17> STATUS EXTRACT ext1
EXTRACT EXT1: RUNNING

GGSCI (redhat346.localdomain) 16> INFO EXTRACT ext1

ON TARGET

Start the Replicat process

GGSCI (devu007) 1> START REPLICAT rep1
Sending START request to MANAGER …
REPLICAT REP1 starting

GGSCI (devu007) 2> INFO REPLICAT rep1

LET US NOW TEST …

ON SOURCE

SQL> conn scott/tiger
Connected.

SQL> UPDATE emp SET sal=9999 WHERE ename=’KING’;

SQL> COMMIT;

ON TARGET

SQL> SELECT SAL FROM emp WHERE ename=’KING’;

SAL
———-
9999

Comments

Popular posts from this blog

Oracle Golden Gate FAQ

Oracle Golden gate - Long running transactions while stopping an extract

FAQ on Oracle Golden gate for unix & windows