Configuring the Oracle GoldenGate Parameter Files for Error Handling
CDR should be used in conjunction with error handling to capture errors that were resolved and errors that CDR could not resolve.
- Conflict resolution is performed before these other error-handling parameters:
HANDLECOLLSIONS,INSERTMISSINGUPDATES, andREPERROR. Use theREPERRORparameter to assign rules for handling errors that cannot be resolved by CDR, or for errors that you do not want to handle through CDR. It might be appropriate to haveREPERRORhandle some errors, and CDR handle others; however, ifREPERRORand CDR are configured to handle the same conflict, CDR takes precedence. TheINSERTMISSINGUPDATESandHANDLECOLLISIONSparameters also can be used to handle some errors not handled by CDR. See the Reference for Oracle GoldenGate for details about these parameters. - (Optional) Create an exceptions table. When an exceptions table is used with an
exceptions
MAPstatement, Replicat sends every operation that generates a conflict (resolved or not) to the exceptionsMAPstatement to be mapped to the exceptions table. Omit a primary key on this table if Replicat is to processUPDATEandDELETEconflicts; otherwise there can be integrity constraint errors.At minimum, an exceptions table should contain the same columns as the target table. These rows will contain each row image that Replicat applied to the target (or tried to apply).
In addition, you can define additional columns to capture other information that helps put the data in transactional context. Oracle GoldenGate provides tools to capture this information through the exceptions
MAPstatement. Such columns can be, but are not limited to, the following:-
The before image of the trail record. This is a duplicate set of the target columns with names such as
col1_before,col2_before, and so forth. -
The current values of the target columns. This also is a duplicate set of the target columns with names such as
col1_current,col2_current, and so forth. -
The name of the target table
-
The timestamp of the conflict
-
The operation type
-
The database error number
-
(Optional) The database error message
-
Whether the conflict was resolved or not
-
- Create an exceptions
MAPstatement to map the exceptions data to the exceptions table. An exceptionsMAPstatement contains:-
(Required) The
INSERTALLRECORDSoption. This parameter converts all mapped operations toINSERTs so that all column values are mapped to the exceptions table. -
(Required) The
EXCEPTIONSONLYoption. This parameter causes Replicat to map operations that generate an error, but not those that were successful. -
(Optional) A
COLMAPclause. If the names and definitions of the columns in the exceptions table are identical to those of the source table, and the exceptions table only contains those columns, noCOLMAPis needed. However, if any names or definitions differ, or if there are extra columns in the exceptions table that you want to populate with additional data, use aCOLMAPclause to map all columns.
-