PURGEOLDEXTRACTS for Manager
Valid For
Manager
Description
Use the PURGEOLDEXTRACTS parameter in a Manager parameter file to purge trail files when Oracle GoldenGate has finished processing them. Without using PURGEOLDEXTRACTS, no purging is performed, and trail files can consume significant disk space.
Using PURGEOLDEXTRACTS as a Manager parameter is recommended rather than using the Extract or Replicat version of PURGEOLDEXTRACTS. As a Manager parameter, PURGEOLDEXTRACTS allows you to manage trail files in a centralized fashion and take into account multiple processes.
How to Use PURGEOLDEXTRACTS for Manager
To control the purging, follow these rules:
-
USECHECKPOINTStriggers a purge when all processes are finished with a file as indicated by their checkpoints. Basing the purges on checkpoints ensures that Manager does not delete any data until all processes are finished with it. This is essential in a production environment to ensure data integrity.USECHECKPOINTSconsiders the checkpoints of both Extract and Replicat before purging. BecauseUSECHECKPOINTSis the default, it need not be specified in thePURGEOLDEXTRACTSstatement. Manager obeysUSECHECKPOINTSunless there is an explicitNOUSECHECKPOINTSentry. -
Use the
MINKEEPrules to set a minimum amount of time to keep data:-
Use
MINKEEPHOURSorMINKEEPDAYSto keep data fornhours or days. -
Use
MINKEEPFILESto keep at leastntrail files including the active file. The default number of files to keep is1.
Use only one of the
MINKEEPoptions. If more than one is used, Oracle GoldenGate selects one of them based on the following:-
If both
MINKEEPHOURSandMINKEEPDAYSare specified, only the last one is accepted, and the other is ignored. -
If either
MINKEEPHOURSorMINKEEPDAYSis used withMINKEEPFILES, thenMINKEEPHOURSorMINKEEPDAYSis accepted, andMINKEEPFILESis ignored.
-
Manager evaluates potential maintenance tasks based on the value set for the
CHECKMINUTES parameter. When that value is reached, Manager
determines which files to purge based on the Extract and Replicat processes
configured on the local system. If at least one process reads a trail file, Manager
applies the specified rules; otherwise, the rules do not take effect. The following
are possible PURGEOLDEXTRACTS rule combinations and the actions
that Manager takes for them:
-
USECHECKPOINTSwithoutMINKEEPrules: If checkpoints indicate that a file has been processed completely, it will be purged unless doing so would violate the default rule to keep at least one file. -
USECHECKPOINTSwithMINKEEPrules: If checkpoints indicate that a file has been processed completely, it will be purged unless doing so would violate theMINKEEPrules. -
NOUSECHECKPOINTSwithoutMINKEEPrules: The checkpoints are not considered, and the file will be purged unless doing so would violate the default rule to keep at least one file. -
NOUSECHECKPOINTSwithMINKEEPrules: A file will be purged unless doing so would violate theMINKEEPrules.
Additional Guidelines for PURGEOLDEXTRACTS for Manager
-
Do not use more than 500
PURGEOLDEXTRACTSparameter statements in the same Manager parameter file. -
When using this parameter, do not permit trail files to be deleted by any user or program other than Oracle GoldenGate. It will cause
PURGEOLDEXTRACTSto function improperly. -
When trails are stored on NFS, there is a difference in system time between the NFS drive and the local system where Manager is running. The trail is created with the NFS time, but the timestamps of the records in the trail are compared with the local system time to determine whether to purge them or not. Take into account any time differences when you create your
MINKEEPrules. -
For Windows, use backslashes
(\)in the path name, and ensure that all processes use backslashes in their parameter files and when creating trails.
Default
USECHECKPOINTS
Syntax
PURGEOLDEXTRACTS trail [, USECHECKPOINTS | NOUSECHECKPOINTS] [, MINKEEP_rule] [, frequency]
-
trail -
The trail to purge. Use a relative or fully qualified name.
-
USECHECKPOINTS -
Allows purging according to any
MINKEEPrules after all Extract and Replicat processes are done with the data as indicated by checkpoints. When usingUSECHECKPOINTS, you can use theUSERIDorUSERIDALIASparameters in the Manager parameter file, so that Manager can query the Replicat checkpoint table to get checkpoint information though it is not required. -
NOUSECHECKPOINTS -
Allows purging without considering checkpoints, based either on the default rule to keep a minimum of one file (if no
MINKEEPrule is used) or the number of files specified with aMINKEEPrule. -
MINKEEP_rule -
Can be one of the following to set rules for the minimum amount of time to keep an inactive file.
-
MINKEEPHOURSn -
Keeps an inactive file for at least the specified number of hours. The minimum is 1 and the maximum is 1000.
-
MINKEEPDAYSn -
Keeps an inactive file for at least the specified number of days. The minimum is 1 and the maximum is 365.
-
MINKEEPFILESn -
Keeps at least
ntrail files, including the active file. The minimum is 1 and the maximum is 100. The default is 1.
-
-
frequency -
Sets the frequency with which to purge inactive trail files. The default time for Manager to evaluate potential maintenance tasks is 10 minutes, as specified with the
CHECKMINUTESparameter. At that interval, Manager evaluates thePURGEOLDEXTRACTSfrequency and conducts the purge after the specifiedfrequency.frequencycan be one of the following:
See "CHECKMINUTES" for more information about controlling the Manager maintenance check interval.
Examples
- Example 1
-
Status:Trail filesAA0000000,AA0000001, andAA0000002exist. Replicat has been stopped for four hours and is not finished processing any of the files.The Manager parameters include:PURGEOLDEXTRACTS /ggs/dirdat/AA*, USECHECKPOINTS, MINKEEPHOURS 2
Result:The amount of time that files must be retained was exceeded, but no files will be purged because checkpoints indicate that Replicat is not finished processing them. - Example 2
-
Status:Trail filesAA0000000,AA0000001, andAA0000002exist. Replicat has been stopped for four hours and is not finished processing any of the files.The Manager parameters include:PURGEOLDEXTRACTS /ggs/dirdat/AA*, NOUSECHECKPOINTS, MINKEEPHOURS 2
Result:All of the trail files will be purged because the minimum time to keep them was satisfied, and checkpoints are not considered before purging. - Example 3
-
Status:Replicat and Extract are finished processing data. There has been no access to the trail files for the last five hours. Trail filesAA0000000,AA0000001, andAA0000002exist. The Manager parameters include:PURGEOLDEXTRACTS /ggs/dirdat/AA*, USECHECKPOINTS, MINKEEPHOURS 4, & MINKEEPFILES 4
Result:This is an example of why only one of theMINKEEPoptions should be set.USECHECKPOINTSrequirements were satisfied, so theMINKEEPrules are considered when determining whether to purgeAA0000002. Only two files will remain ifAA0000002is purged, and that violates theMINKEEPFILESrule. Because bothMINKEEPFILESandMINKEEPHOURSare specified, however,MINKEEPFILESis ignored. The file will be purged because it has not been accessed for five hours, and that satisfies theMINKEEPHOURSrequirement of four hours. - Example 4
-
The following example is for a Windows environment:
PURGEOLDEXTRACTS dirdat\AA*, USECHECKPOINTS