Additional setting for Extract and Replicate process in Golden Gate

Additional setting for purging, autostart,rollover in the Extract and Replicate process of Golden Gate

REPORTCOUNT
Parameter to have the Extract or Replicat automatically add a count of the records GoldenGate has processed since startup.

Example of what the reporting output looks like:

1000 records processed as of 2010-01-28 11:30:40 (rate 154,delta 215)
Rate = # of records processed since startup / total time since startup
Delta = # of records since last report / time since last report

REPORT
You can use the REPORT parameter to have the Extract or Replicat runtime statistics into your
report, such as the following:

***********************************************************************
* ** Run Time Statistics ** *
***********************************************************************
Report at 2011-01-15 13:53:30 (activity since 2011-01-13 23:23:10)
Output to /gger/ggs/dirdat/l2:

From Table HR.EMPLOYEES:
# inserts: 6
# updates: 2
# deletes: 1
# discards: 0

REPORTROLLOVER
If an Extract or Replicat runs continuously for a long period, you may notice that the report file becomes rather large.
To control the size of the report file, you can have GoldenGate automatically roll over the reports on a daily or weekly basis.
The example rolls over the report file once a day at 1:15 a.m. 

ReportRollover at 01:15

Reporting Discarded Records 
GoldenGate won’t produce a discard file to show you which records have been discarded. If you want to see the discards, you can instruct GoldenGate to write them out to a file using the DISCARDFILE parameter. 
Example tells GoldenGate to generate a discard file for the human resources schema Extract named LHREMD1.
You also have any new records appended to the discard file with the APPEND parameter.
To keep the discard file from getting too large, you roll it over every Sunday at 2 a.m. with the DISCARDROLLOVER parameter:

DiscardFile dirrpt/LHREMD1.dsc, Append
DiscardRollover at 02:00 ON SUNDAY

Purging Old Trail Files
Automatically purge your old trail files after they have been processed using the PURGEOLDEXTRACTS parameter.
It’s best to add it to your Manager parameter file so purging can be managed centrally for all
Extracts and Replicats.

PurgeOldExtracts dirdat/*, UseCheckpoints, MinKeepDays 2

First you tell GoldenGate to purge the extracts in your dirdat directory where the trail files are stored.
The USECHECKPOINTS option tells GoldenGate to only delete the trail files after they have been fully processed by the Extracts and Replicats according to the checkpoint file.
You should almost always specify the USECHECKPOINTS option along with PURGEOLDEXTRACTS because otherwise your trail files may be deleted before they’re processed.
Finally, you keep the trail files for a minimum of two days after they have been processed per the MINKEEPDAYS option.

Adding Automatic Process Startup and Restart
The AUTOSTART parameter, as shown in the following example, automatically starts all the Extracts and Replicats when the Manager starts.

AutoStart ER *

Adding a Checkpoint Table
GoldenGate maintains a checkpoint file on disk to keep track of transaction processing. In addition, you can create a checkpoint table in your target database. Doing so lets the Replicat include the checkpoint itself as part of the transaction processing and allows for better recover-ability in certain
circumstances.

CheckPointTable gger.chkpt

GLOBALS file is used to specify GoldenGate parameters that apply to the entire GoldenGate instance,
such as CHECKPOINTTABLE. The GLOBALS file is located in the GoldenGate software installation directory (in the example, /gger/ggs).
Extract and Replicat parameter files, which are located in the dirprm subdirectory.

Create the checkpoint table in the target database:

GGSCI (targetserver) 1> dblogin userid gger password userpw
Successfully logged into database.

GGSCI (targetserver) 2> add checkpointtable
No checkpoint table specified, using GLOBALS specification (gger.chkpt)...
Successfully created checkpoint table GGER.CHKPT.

another checkpoint command to verify that the checkpoint table exists:
GGSCI (targetserver) 1> info checkpointtable gger.chkpt
Checkpoint table GGER.CHKPT created 2011-01-30 22:02:03.

Example of files using above parameter to make more reliable process of Golden Gate

Extract Process File

GGSCI (sourceserver) 1> edit params LHREMD1
Extract LHREMD1
-------------------------------------------------------------------
-- Local extract for HR schema
-------------------------------------------------------------------
SETENV (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)
USERID GGER@SourceDB, PASSWORD userpw
ReportCount Every 30 Minutes, Rate
Report at 01:00
ReportRollover at 01:15
DiscardFile dirrpt/LHREMD1.dsc, Append
DiscardRollover at 02:00 ON SUNDAY
ExtTrail dirdat/l1
Table HR.*;

Replicat process File

GGSCI (targetserver) 1> edit params RHREMD1
Replicat RHREMD1
-------------------------------------------------------------------
-- Replicat for HR Schema
-------------------------------------------------------------------
SETENV (NLS_LANG = AMERICAN_AMERICA.AL32UTF8)
USERID GGER@TargetDB, PASSWORD userpw
AssumeTargetDefs
ReportCount Every 30 Minutes, Rate
Report at 01:00
ReportRollover at 01:15
DiscardFile dirrpt/RHREMD1.dsc, Append
DiscardRollover at 02:00 ON SUNDAY
Map HR.*, Target HR.* ;

Goldengate manager parameter file

GGSCI (server) 1> edit params MGR
-------------------------------------------------------------------
-- GoldenGate Manager
-------------------------------------------------------------------
port 7840
AutoStart ER *
AutoRestart ER *
PurgeOldExtracts /gger/ggs/dirdat/*, UseCheckpoints, MinKeepDays 2

Advertisements

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 )

Google+ photo

You are commenting using your Google+ 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 )

w

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.