Subscribe to Posts by Email

Subscriber Count

    696

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

Example 13: Purging Trail Files

As like archive log clean up, one should also think about purging golden gate trail files to purge them.

By default, Goldengate manager does not purge them unless the purgeoldextracts parameter is not specified in the mgr param file.

Syntax for purging trail files

PURGEOLDEXTRACTS trail [, USECHECKPOINTS | NOUSECHECKPOINT ] [, MINKEEP_rule MINKEEPHOURS|MINKEEPDAYS|MINKEEPFILES] 

So now question is how often the manager purges the trail records, by default it is 10 MINS as per CHECKMINUTES default value. Even you do not specify this 10 mins is applicable.

For example, in the following the manager process purge the old extracts. The USECHECKPOINTS parameter tells manager process to check trail file is already applied or not in Checkpoint table. Do NOT use NOUSECHECKPOINT, since it will delete all the trail files without considering the trail file

.ggsci

./ggsci

info all

EDIT PARAMS MGR

### Add the bold line to your manager Param file ###

PORT 7809

USERID ggs_owner, PASSWORD ggs_owner

PURGEOLDEXTRACTS /data/ggate/dirdat/ex, USECHECKPOINTS

 

For example, you want to retain trails for 10 Hours and rest to be deleted use MINKEEP_RULE

.ggsci

./ggsci

info all

EDIT PARAMS MGR

### Add the bold line to your manager Param file ###

PORT 7809

USERID ggs_owner, PASSWORD ggs_owner

PURGEOLDEXTRACTS /data/ggate/dirdat/ex, USECHECKPOINTS , MINKEEPHOURS 10

 

For example, if you want to delete the DDL History also, you can use PURGEDDLHISTORY Marker in the parameter file

.ggsci

./ggsci

info all

EDIT PARAMS MGR

### Add the bold line to your manager Param file ###

PORT 7809

USERID ggs_owner, PASSWORD ggs_owner

PURGEOLDEXTRACTS /data/ggate/dirdat/ex, USECHECKPOINTS , MINKEEPHOURS 10

PURGEDDLHISTORY MINKEEPDAYS 3, MAXKEEPDAYS 5, FREQUENCYMINUTES 30

So this is all about configuration, what about when you hit a filesystem issue and you want to purge the trails and change the MINKEEPHOURS 10 reasonable number.

Lets check it. Check the extract or replicat trail file location by using

ggsci> info extract ext3 detail

cd /data/ggate/

[oracle@sourcehost]/data/ggate: du -sch *
4.3M    rt
15G     ex
15G     total
 
My extract folder showing 15G extracts are there. Now to purge this I will need to edit the manager parameter file, and you see below it keeps 10 Hours of trail files. By which using checkpoints , so its safe to delete those trail files even keeping for 5 hours. Lets do that.
 

.ggsci

./ggsci

info all

EDIT PARAMS MGR

PORT 7809

USERID ggs_owner, PASSWORD ggs_owner

PURGEOLDEXTRACTS /data/ggate/dirdat/ex, USECHECKPOINTS , MINKEEPHOURS 10

Change the Hours to 5, Ensure you have USECHECKPOINTS in parameterfile, this will make sure the trails files need for GG will not be deleted.

EDIT PARAMS MGR

PORT 7809

USERID ggs_owner, PASSWORD ggs_owner

PURGEOLDEXTRACTS /data/ggate/dirdat/ex, USECHECKPOINTS , MINKEEPHOURS 5

Once you changed , *** IMP *** Do not stop the manager, just refresh it. After 10 mins (maintainence activity default) it will start purging. If you stop/start the manager it will stop the extract and replicat process running on host.

GGSCI (source) 3> refresh mgr
 
Sending REFRESH request to MANAGER ...
Mgr Params Updated
 
After 10 mins you can see in error log file. The old purge files start purging.
 
If you want to purge the trail files immediately, you can use,
 
GGSCI(source) > send manager getpurgeoldextracts
 
GGSCI (source) > send manager purgeoldextracts
 
This command will immediately remove the trails from the location.
 
Also note, you must add each individual location for trails file to purge each extract trail files.