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
.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
Follow Me!!!