DISCARDFILE | NODISCARDFILE

Valid For

Extract and Replicat

Description

Use the DISCARDFILE parameter to do the following:

Use the NODISCARDFILE parameter to disable the use of a discard file. If NODISCARDFILE is used with DISCARDFILE, the process abends.

When using DISCARDFILE, use either the PURGE or APPEND option. Otherwise, you must specify a different discard file name before starting each process run, because Oracle GoldenGate will not write to an existing discard file without one of these instructions and will terminate.

See “DISCARDROLLOVER” for how to control how often the discard file is rolled over to a new file.

For more information about the discard file, see Overview of Oracle GoldenGate Error Handling.

Default

If a process is started with the START command, it generates a discard file as follows:

When you start a process from the command line of the operating system, you should not generate a discard file by default.

Syntax

DISCARDFILE { [file_name]
[, APPEND | PURGE]
[, MAXBYTES n | MEGABYTES n] } |
NODISCARDFILE

DISCARDFILE

Indicates that the name or other attribute of the discard file is being changed.

file_name

The relative or fully qualified name of the discard file, including the actual file name. For a coordinated Replicat, specify a file name of up to five characters, because each file name is appended with the thread ID of the thread that writes it. To store the file in the Oracle GoldenGate directory, a relative path name is sufficient, because Oracle GoldenGate qualifies the name with the Oracle GoldenGate installation directory.

APPEND

Adds new content to existing content if the file already exists. If neither APPEND nor PURGE is used, you must specify a different discard file name before starting each process run.

PURGE

Purges the file before writing new content. If neither PURGE nor APPEND is used, you must specify a different discard file name before starting each process run.

MAXBYTES n

Sets the maximum size of the file in bytes. The valid range is from 1 to 4096967295. The default is 3000000. If the specified size is exceeded, the process abends.

MEGABYTES n

Sets the maximum size of the file in megabytes. The valid range is from 1 to 4096. The default is 3. If the specified size is exceeded, the process abends.

NODISCARDFILE

Prevents the process from creating a discard file.

Example

Example 1

This example specifies a non-default file name and extension, non-default write mode, and non-default maximum file size. This example shows how you could change the default properties of a discard file for an online process or specify the use of a discard file for a process that starts from the command line of the operating system and has no discard file by default.

DISCARDFILE .dirrpt/discard.txt, APPEND, MEGABYTES 20

Example 2

This example changes only the write mode of the default discard file for an online process.

DISCARDFILE .dirrpt/finance.dsc, APPEND

Example 3

This example disables the use of a discard file for an online process.

NODISCARDFILE