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:
-
USECHECKPOINTS
triggers 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.USECHECKPOINTS
considers the checkpoints of both Extract and Replicat before purging. BecauseUSECHECKPOINTS
is the default, it need not be specified in thePURGEOLDEXTRACTS
statement. Manager obeysUSECHECKPOINTS
unless there is an explicitNOUSECHECKPOINTS
entry. -
Use the
MINKEEP
rules to set a minimum amount of time to keep data:-
Use
MINKEEPHOURS
orMINKEEPDAYS
to keep data forn
hours or days. -
Use
MINKEEPFILES
to keep at leastn
trail files including the active file. The default number of files to keep is1
.
Use only one of the
MINKEEP
options. If more than one is used, Oracle GoldenGate selects one of them based on the following:-
If both
MINKEEPHOURS
andMINKEEPDAYS
are specified, only the last one is accepted, and the other is ignored. -
If either
MINKEEPHOURS
orMINKEEPDAYS
is used withMINKEEPFILES
, thenMINKEEPHOURS
orMINKEEPDAYS
is accepted, andMINKEEPFILES
is 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 PURGEOLDEXTRACT
rule combinations and the actions that Manager takes for them:
-
USECHECKPOINTS
withoutMINKEEP
rules: 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. -
USECHECKPOINTS
withMINKEEP
rules: If checkpoints indicate that a file has been processed completely, it will be purged unless doing so would violate theMINKEEP
rules. -
NOUSECHECKPOINTS
withoutMINKEEP
rules: 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. -
NOUSECHECKPOINTS
withMINKEEP
rules: A file will be purged unless doing so would violate theMINKEEP
rules.
Additional Guidelines for PURGEOLDEXTRACTS for Manager
-
Do not use more than 500
PURGEOLDEXTRACTS
parameter 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
PURGEOLDEXTRACTS
to 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
MINKEEP
rules. -
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
MINKEEP
rules after all Extract and Replicat processes are done with the data as indicated by checkpoints. When usingUSECHECKPOINTS
, you can use theUSERID
orUSERIDALIAS
parameters 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
MINKEEP
rule is used) or the number of files specified with aMINKEEP
rule. -
MINKEEP_rule
-
Can be one of the following to set rules for the minimum amount of time to keep an inactive file.
-
MINKEEPHOURS
n
-
Keeps an inactive file for at least the specified number of hours. The minimum is 1 and the maximum is 1000.
-
MINKEEPDAYS
n
-
Keeps an inactive file for at least the specified number of days. The minimum is 1 and the maximum is 365.
-
MINKEEPFILES
n
-
Keeps at least
n
trail 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
CHECKMINUTES
parameter. At that interval, Manager evaluates thePURGEOLDEXTRACTS
frequency and conducts the purge after the specifiedfrequency
.frequency
can be one of the following:
See "CHECKMINUTES" for more information about controlling the Manager maintenance check interval.
Examples
- Example 1
-
Status:
Trail filesAA0000000
,AA0000001
, andAA0000002
exist. 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
, andAA0000002
exist. 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
, andAA0000002
exist. The Manager parameters include:PURGEOLDEXTRACTS /ggs/dirdat/AA*, USECHECKPOINTS, MINKEEPHOURS 4, & MINKEEPFILES 4
Result:
This is an example of why only one of theMINKEEP
options should be set.USECHECKPOINTS
requirements were satisfied, so theMINKEEP
rules are considered when determining whether to purgeAA0000002
. Only two files will remain ifAA0000002
is purged, and that violates theMINKEEPFILES
rule. Because bothMINKEEPFILES
andMINKEEPHOURS
are specified, however,MINKEEPFILES
is ignored. The file will be purged because it has not been accessed for five hours, and that satisfies theMINKEEPHOURS
requirement of four hours. - Example 4
-
The following example is for a Windows environment:
PURGEOLDEXTRACTS dirdat\AA*, USECHECKPOINTS