Subscriber Count

    448

Subscribe2

Pages

Contact for Online learnings
* indicates required field
Thanks for the inquiry. You will be receiving a mail shortly with course details. If not please check the spam folder once and mark our mail as not a spam.

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.