Thursday, December 15, 2011

Implementing Parallel Extracts and Replicats Using Key Ranges – Performance Tuning

Implementing Parallel Extracts and Replicats Using Key Ranges – Performance Tuning
Creating parallel Extracts and replicates is to use the @RANGE function to spilt the incoming table rows into equal buckets using a Golden gate hash algorithm on the key values.
You do this to divide the replication workload into parallel processes by key ranges and make the replication process more data and reduce the replicate lag.





Sample Table structure:
Create table sender.empl (empid number(10),empname varchar2(10),constraint emp_key unique(empid));
Create table receiver.empl (empid number(10),empname varchar2(10),constraint emp_key unique(empid));


On Source database

1. GGSCI> add extract ext_ran, tranlog, Begin now

2. GGSCI> add exttrail /u01/app/oracle/product/GG1/dirdat/lt,extract ext_ran

3. GGSCI> add extract dpump, exttrailsource /u01/app/oracle/product/GG1/dirdat/lt

4. GGSCI> edit params ext_ran

Extract ext_ran
Userid ogg@goldengate:1521/source,password ****
Exttrail /u01/app/oracle/product/GG1/dirdat/lt
Table sender.empl;

5. GGSCI> add rmttrail /u01/app/oracle/product/GG2/dirdat/rt,extract dpump, megabytes 500

6. GGSCI> edit params dpump
Extract dpump
Userid ogg@goldengate:1521/source,password ****
Rmthost goldengate,mgrport 7810
Rmttrail /u01/app/oracle/product/GG2/dirdat/rt
Passthru
Table sender.empl;

On Target database

1. GGSCI> add replicat rep_ran1, exttrail /u01/app/oracle/product/GG2/rt,checkpointtable ogg.chkptab

2. GGSCI> edit params rep_ran1

Replicat rep_ran1
Userid OGG@goldengate:1521/target,password ****
MAP sender.empl, TARGET receiver.empl, EMPLOYEES, COLMAP (USEDEFAULTS), FILTER (@RANGE (1,3));

3. GGSCI> add replicat rep_ran2, exttrail /u01/app/oracle/product/GG2/rt,checkpointtable ogg.chkptab

4. GGSCI> edit params rep_ran2

Replicat rep_ran2
Userid OGG@goldengate:1521/target,password ****
MAP sender.empl, TARGET receiver.empl, EMPLOYEES,COLMAP (USEDEFAULTS),FILTER (@RANGE (2,3));

5. GGSCI> add replicat rep_ran3, exttrail /u01/app/oracle/product/GG2/rt,checkpointtable ogg.chkptab

6. GGSCI> edit params rep_ran3

Replicat rep_ran3
Userid OGG@goldengate:1521/target,password ****
MAP sender.empl, TARGET receiver.empl, COLMAP (USEDEFAULTS),FILTER (@RANGE (3,3));


On Source & Target database

1. GGSCI > start extract exp_ran

2. GGSCI> start replicat rep_ran1

3. GGSCI> start replicat rep_ran2

4. GGSCI> start replicat rep_ran3

0r

1. GGSCI> start replicat rep_ran*

After some changes are applied , you can check the status of the replicats to make sure they’re processing properly.

1. GGSCI> info rep *

No comments:

Post a Comment