GoldenGate Initial-Load Direct Load

This article will demostrate how to perform a OGG Initial Load using the Direct Load technique.

Other Initial Load techniques and their advantages and disadvantages can be found here.

Pre-requisites

OGG is installed on source and target systems

Environment

OGG : 11.2.1.0.1
Database : 11.2.0.3
Linux : OEL 6 ( 64 bit )

Direct Load Steps

1. Configure the initial-load processes

Extract


GGSCI> ADD EXTRACT icdl, SOURCEISTABLE

GGSCI> INFO EXTRACT *, TASKS

EXTRACT    ICDL      Initialized   2013-05-23 16:20   Status STOPPED
Checkpoint Lag       Not Available
Log Read Checkpoint  Not Available
                     First Record         Record 0
Task                 SOURCEISTABLE


cat ./dirprm/icdl.prm

EXTRACT icdl
-- --------------------------------------------------
-- environment
-- --------------------------------------------------
SETENV (ORACLE_HOME="/u01/app/oracle/product/11.2.0/dbhome_1")
SETENV (ORACLE_SID="GGDB1")
SETENV (NLS_LANG="AMERICAN_AMERICA.WE8MSWIN1252")
USERID ggate, PASSWORD ggate
-- --------------------------------------------------
RMTHOST gglab1n2, mgrport 7809
RMTTASK REPLICAT, GROUP irdl
TABLE soe.inventories;
TABLE soe.product_descriptions;

Replicat


GGSCI> ADD REPLICAT irdl, SPECIALRUN

GGSCI> INFO REPLICAT *, TASKS

REPLICAT   IRDL      Initialized   2013-05-23 16:21   Status STOPPED
Checkpoint Lag       00:00:00 (updated 00:00:11 ago)
Log Read Checkpoint  Not Available
Task                 SPECIALRUN


cat ./dirprm/irdl.prm

REPLICAT irdl
-- --------------------------------------------------
-- environment 
-- --------------------------------------------------
SETENV (ORACLE_HOME="/u01/app/oracle/product/11.2.0/dbhome_1")
SETENV (ORACLE_SID="GGDB2")
SETENV (NLS_LANG="AMERICAN_AMERICA.WE8MSWIN1252")
USERID ggate, PASSWORD ggate
-- --------------------------------------------------
-- options
-- --------------------------------------------------
ASSUMETARGETDEFS
DBOPTIONS SUPPRESSTRIGGERS
-- --------------------------------------------------
-- files
-- --------------------------------------------------
DISCARDFILE ./dirrpt/irdl.dsc, PURGE
-- --------------------------------------------------
-- mappings
-- --------------------------------------------------
MAP soe.inventories , TARGET soe.inventories;
MAP soe.product_descriptions , TARGET soe.product_descriptions;

2. Configure the change-synchronization processes

This is the normal replication methods, so I will not cover them here to keep things short. You can see example of this in some of my other posts.

3. Start the change-synchronization Extract on the Source site

GGSCI> start extract csoea

4. Start the Initial Load Extract

GGSCI (gglab1n1) > START EXTRACT icdl

GGSCI (gglab1n1) > INFO EXTRACT *, TASKS

EXTRACT    ICDL      Last Started 2013-05-23 16:22   Status RUNNING
Checkpoint Lag       Not Available
Log Read Checkpoint  Table SOE.INVENTORIES
                     2013-05-23 16:22:50  Record 14970
Task                 SOURCEISTABLE

Note that both the extract and replicat processes are now running. This is a result of the “RMTTASK” parameter in the extract parameter file.

GGSCI (gglab1n2)> INFO REPLICAT *, TASKS

REPLICAT   IRDL      Initialized   2013-05-23 16:21   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:02:16 ago)
Log Read Checkpoint  Not Available
Task                 SPECIALRUN

5. Check the report on both the source and target systems

Monitoring the report files will show you what tables are being processed and when the load is complete.

...
***********************************************************************
*                   ** Run Time Statistics **                         *
***********************************************************************


Report at 2013-05-23 18:47:03 (activity since 2013-05-23 16:22:32)

Output to irdl:

From Table SOE.INVENTORIES:
       #                   inserts:    900667
       #                   updates:         0
       #                   deletes:         0
       #                  discards:         0
From Table SOE.PRODUCT_DESCRIPTIONS:
       #                   inserts:      1000
       #                   updates:         0
       #                   deletes:         0
       #                  discards:         0
...

You can also use the info command to check the status.

GGSCI (gglab1n1) > INFO EXTRACT *, TASKS

EXTRACT    ICDL      Last Started 2013-05-23 16:22   Status STOPPED
Checkpoint Lag       Not Available
Log Read Checkpoint  Table SOE.PRODUCT_DESCRIPTIONS
                     2013-05-23 18:47:01  Record 1000
Task                 SOURCEISTABLE


GGSCI (gglab1n2) > INFO REPLICAT *, TASKS

REPLICAT   IRDL      Initialized   2013-05-23 16:21   Status STOPPED
Checkpoint Lag       00:00:00 (updated 00:08:29 ago)
Log Read Checkpoint  Not Available
Task                 SPECIALRUN

6. Once you verify that the intial load completes, start change synchronization REPLICAT on the Target system

GGSCI> start replicat rsoeas

Monitor the replicat for any errors and the current time and position of the records it is applying.

Next, verify that the change synchronization replicat has passed the point where the initial-load replicat stopped.

7. Turn off HANDLECOLLISIONS

SEND REPLICAT rsoeas, NOHANDLECOLLISIONS

Lastly, edit the replicat parameter file and remove HANDLECOLLISIONS so that it is not enabled next time the replicat starts.

Advertisements

2 thoughts on “GoldenGate Initial-Load Direct Load

  1. i want to know is there a limit on number of rows that can be replicated in initial load ?i was trying replication with 30000 records but it is not replicating all the data to the target.

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