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 preferred over 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. Because USECHECKPOINTS is the default, it need not be specified in the PURGEOLDEXTRACTS statement. Manager obeys USECHECKPOINTS unless there is an explicit NOUSECHECKPOINTS entry.

  • Use the MINKEEP rules to set a minimum amount of time to keep data:

    • Use MINKEEPHOURS or MINKEEPDAYS to keep data for n hours or days.

    • Use MINKEEPFILES to keep at least n trail files including the active file. The default number of files to keep is 1.

    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 and MINKEEPDAYS are specified, only the last one is accepted, and the other is ignored.

    • If either MINKEEPHOURS or MINKEEPDAYS is used with MINKEEPFILES, then MINKEEPHOURS or MINKEEPDAYS is accepted, and MINKEEPFILES 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 without MINKEEP 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 with MINKEEP rules: If checkpoints indicate that a file has been processed completely, it will be purged unless doing so would violate the MINKEEP rules.

  • NOUSECHECKPOINTS without MINKEEP 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 with MINKEEP rules: A file will be purged unless doing so would violate the MINKEEP 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.

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 using USECHECKPOINTS, you can use the USERID or USERIDALIAS 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 a MINKEEP 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.

MINKEEPDAYS n

Keeps an inactive file for at least the specified number of days.

MINKEEPFILES n

Keeps at least n trail files, including the active file.

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 the PURGEOLDEXTRACTS frequency and conducts the purge after the specified frequency.

frequency can be one of the following:

FREQUENCYMINUTES n

Sets the frequency in minutes. The default purge frequency is 60 minutes.

FREQUENCYHOURS n

Sets the frequency in hours.

See "CHECKMINUTES" for more information about controlling the Manager maintenance check interval.

Examples

Example 1   

Status: Trail files AA000000, AA000001, and AA000002 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 files AA000000, AA000001, and AA000002 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 files AA000000, AA000001, and AA000002 exist. The Manager parameters include:

PURGEOLDEXTRACTS /ggs/dirdat/AA*, USECHECKPOINTS, MINKEEPHOURS 4, &
MINKEEPFILES 4

Result: This is an example of why only one of the MINKEEP options should be set. USECHECKPOINTS requirements were satisfied, so the MINKEEP rules are considered when determining whether to purge AA000002. Only two files will remain if AA000002 is purged, and that violates the MINKEEPFILES rule. Because both MINKEEPFILES and MINKEEPHOURS are specified, however, MINKEEPFILES is ignored. The file will be purged because it has not been accessed for five hours, and that satisfies the MINKEEPHOURS requirement of four hours.