Use the Discard File

By default, a discard file is generated whenever a process is started with the START command. The discard file captures information about Oracle GoldenGate operations that failed. This information can help you resolve data errors, such as those that involve invalid column mapping.

The discard file reports such information as:

  • The database error message

  • The sequence number of the data source or trail file

  • The relative byte address of the record in the data source or trail file

  • The details of the discarded operation, such as column values of a DML statement or the text of a DDL statement.

To view the discard file, use a text editor or use the VIEW REPORT command in Admin Client.

The default discard file has the following properties:

  • The file is named after the process that creates it, with a default extension of .dsc. Example: finance.dsc.

  • The file is created in the dirrpt sub-directory of the Oracle GoldenGate installation directory.

  • The maximum file size is 50 megabytes.

  • At startup, if a discard file exists, it is purged before new data is written.

You can change these properties by using the DISCARDFILE parameter. You can disable the use of a discard file by using the NODISCARDFILE parameter.

If a process is started from the command line of the operating system, it does not generate a discard file by default. You can use the DISCARDFILE parameter to specify the use of a discard file and its properties.

Once created, a discard file must remain in its original location for Oracle GoldenGate to operate properly after processing has started.

Maintain Discard and Report Files

By default, discard files and report files are aged the same way. A new discard or report file is created at the start of a new process run. Old files are aged by appending a sequence number from 0 (the most recent) to 9 (the oldest) to their names.

If the active report or discard file reaches its maximum file size before the end of a run (or over a continuous run), the process abends unless there is an aging schedule in effect. Use the DISCARDROLLOVER and REPORTROLLOVER parameters to set aging schedules for the discard and report files respectively. These parameters set instructions for rolling over the files at regular intervals, in addition to when the process starts. Not only does this control the size of the files and prevent process outages, but it also provides a predictable set of archives that can be included in your archiving routine. For more information, see the following documentation:

No process ever has more than ten aged reports or discard files and one active report or discard file. After the tenth aged file, the oldest is deleted when a new report is created. It is recommended that you establish an archiving schedule for aged reports and discard files in case they are needed to resolve a service request.

Table 10-1 Current Extract and Aged Reports

Permissions X Date Report
-rw-rw-rw-
1 ggs ggs
4384 Oct 5  14:02
TCUST.rpt
-rw-rw-rw-
1 ggs ggs
1011 Sep 27 14:10
TCUST0.rpt
-rw-rw-rw-
1 ggs ggs
3184 Sep 27 14:10
TCUST1.rpt
-rw-rw-rw-
1 ggs ggs
2655 Sep 27 14:06
TCUST2.rpt
-rw-rw-rw-
1 ggs ggs
2655 Sep 27 14:04
TCUST3.rpt
-rw-rw-rw-
1 ggs ggs
2744 Sep 27 13:56
TCUST4.rpt
-rw-rw-rw-
1 ggs ggs
3571 Aug 29 14:27
TCUST5.rpt