Showing posts with label Goldengate Initial Load. Show all posts
Showing posts with label Goldengate Initial Load. Show all posts

Thursday, June 23, 2011

Goldengate Initial load (File to Replicat Method)

file to replicat initial load method

On Source:
------------
SQL> select count(*) from arun.sales;

  COUNT(*)
----------
         9

On Target:

SQL> select count(*) from arun.sales;

  COUNT(*)
----------
         3

On Source:
----------

GGSCI (RAC2) 1>EDIT PARAMS ILOAD100

SOURCEISTABLE
USERID ggs_admin@oradb1, PASSWORD ggs_admin
RMTHOST rac1, MGRPORT 7809
RMTFILE ./dirdat/int2.dat, purge
TABLE SCOTT.EMP;
table arun.sales;

execute extract command from $GGS_HOME

 $ extract paramfile /u01/app/oracle/ggs/dirprm/iload100.prm reportfile dirrpt/iload100.rpt

CHECK THE REPORT FILE

view /u01/app/oracle/ggs/dirrpt/iload100.rpt

On Target:
-----------

GGSCI (rac1) 3> edit params iload200

REPLICAT ILOAD200
SPECIALRUN
ASSUMETARGETDEFS
HANDLECOLLISIONS
USERID ggs_admin@oradb2, password ggs_admin
EXTFILE ./dirdat/int2.dat
DISCARDFILE ./dirdat/iload200.dsc, purge
MAP SCOTT.EMP, TARGET SCOTT.EMP;
MAP ARUN.SALES, TARGET ARUN.SALES;
END RUNTIME

GGSCI (rac1) 4> add replicat iload200, extfile ./dirdat/int2.dat, checkpointtable ggs_admin.chkpt

note: checkpointtable is optional because the replicat process is a one time run process in this case. check my previous blog for checkpoint creation instructions.


Now start the replicat process on target
----------------------------------------

GGSCI (rac1) 2> start iload200

Now check both Source and target:
---------------------------------
On Source:

SQL> select count(*) from arun.sales;

  COUNT(*)
----------
         9

On Target:

SQL> select count(*) from arun.sales;

  COUNT(*)
----------
         9

At this point transaction synchronization can start.