Valid for
Replicat
Description
Use REPERROR
to determine how Replicat responds to record errors that occur during replication. Using REPERROR
, you can handle most record errors in a default manner and specific errors differently. For example, you can ignore duplicate record errors but abort processing in all other cases.
The parameter "HANDLECOLLISIONS | NOHANDLECOLLISIONS" describes how to handle missing and duplicate record errors as special cases.
See the Oracle GoldenGate for HP NonStop Administrator Guide for information on error handling for primary key updates, where multi-staged I/O can result in partial replication for non-audited files.
Default
ABEND
Syntax
REPERROR (error, response) | RESET
The following are possible response
values and options:
REPERROR (error, [IGNORE | EXCEPTION | DISCARD | ABEND]) REPERROR (error, RETRYOP [, MAXRETRIES number] [, DELAYSECS seconds] [, DELAYCSECS csecs]) REPERROR (error, TRANSABORT [, MAXRETRIES number] [, DELAYSECS seconds] [, DELAYCSECS csecs]) REPERROR (error, FILEOP [, MAXRETRIES number] [, DELAYCSECS csecs] [, DELAYSECS seconds] [, ABEND | WARN | IGNORE | PURGETARGET] [, CREATE | ALTER | RENAME | PURGE | SETMODE | CONTROL | CHANGELABEL]) REPERROR (error, RETRYOPEN [, MAXRETRIES number] [, DELAYSECS seconds] [, DELAYCSECS csecs]) REPERROR (error [IOTYPE [,INSERT] [,UPDATE] [,DELETE]] {IGNORE | EXCEPTION | DISCARD | ABEND | TRANSABORT})
error
Valid values are as follows.
DEFAULT
Sets a global response to all errors except those for which explicit REPERROR
statements are specified.
DEFAULT2
Signals a backup default exception handling action when DEFAULT
is set to EXCEPTION
. Use DEFAULT2
when an exception map is not specified for a map that experiences an error.
error_number
A Guardian or SQL error number.
response
Can be one of the following:
ABEND
Roll back the transaction and terminate processing abnormally. ABEND
is the default.
DISCARD
Log the error in the discard file but continue processing the transaction and subsequent transactions.
EXCEPTION
Handle the error as an exception. In anticipation of possible errors, you can create a separate MAP
statement that executes only after an error. Use this MAP
statement, for example, to map columns from a failed update statement into a "missing update" table. In the parameter file, specify the map that will handle the exception after the map that failed.
FILEOP
Specifies error handling behavior for each I/O type. The default is to ABEND
. You cannot specify multiple actions for a given error and operation type, nor can you specify multiple operation types on a single statement.
Note:
PURGETARGET
is valid only for the CREATE
option on Enscribe files. It purges the target after a file create and retries the CREATE
.
IGNORE
Ignore the error.
IOTYPE
Specifies behavior that should be applied for the designated types of operations. If IOTYPE
is used, at least one of the operation types (insert, update, or delete) must be included.
RETRYOPEN
Retry a file open error. If the error is on file open or during the mapping evaluation, RETRYOPEN
retries the operation indefinitely every 60 seconds. For example, if a file does not yet exist on the target platform, an operator could create it after seeing the open error, and processing will continue uninterrupted.
RETRYOP
Retry an insert, update, or delete operation. Use the MAXRETRIES
option to limit the number of retries to the value of number
For example, if Error 45 (file is full) indicates the table is out of extents, RETRYOP
with MAXRETRIES
gives you time to add extents so the transaction does not fail. Replicat abends after the specified number of MAXRETRIES
.
To specify the length of time between attempts, set RETRYDELAY
as described on "RETRYDELAY".
TRANSABORT
Abort the transaction and reposition to the beginning of the transaction. This will continue either until the record(s) are processed successfully or MAXRETRIES
expires. If MAXRETRIES
is not set, then the TRANSABORT
action will loop continuously. To force an infinite loop of retries you can set MAXRETRIES
to -1. Use the DELAY
option to delay the retry.
The default delay between retries is 60 seconds, but this can be changed using the DELAY
option.
The TRANSABORT
option is useful for handling timeouts and deadlocks on databases that support those conditions.
RESET
Use RESET
to remove all of the REPERROR
settings made at the root level of the parameter file above the RESET
.
Note:
The RESET
option clears only the global error settings. It does not apply to and is not valid with REPERROR
used within a MAP
statement.
Examples
This example shows valid actions and operation types for the option FILEOP.
REPERROR (11, FILEOP, RENAME, WARN) REPERROR (14, FILEOP, RENAME, ABEND) REPERROR (48, FILEOP, RENAME, ABEND) REPERROR (10, FILEOP, CREATE, ABEND) REPERROR (10, FILEOP, CREATE, PURGETARGET) REPERROR (14, FILEOP, CREATE, ABEND) REPERROR (11, FILEOP, PURGE, ABEND) REPERROR (14, FILEOP, PURGE, ABEND) REPERROR (48, FILEOP, PURGE, ABEND) REPERROR (48, FILEOP, SETMODE,IGNORE) REPERROR (48, FILEOP, CONTROL, IGNORE) REPERROR (48, FILEOP, CHANGELABEL, ABEND)
This example aborts processing for most file errors, but ignores duplicate record errors for both SQL tables (error -8227) and Enscribe files (Error 10).
REPERROR (DEFAULT, ABEND) REPERROR (-8227, IGNORE) REPERROR (10, IGNORE) REPERROR (11, RETRYOPEN) REPERROR (45, RETRYOP, MAXRETRIES 50)
This example invokes an exception map for all errors on the ACCOUNT
table. Errors on other tables cause Replicat to abend (due to the absence of an exception map for those tables).
REPERROR (DEFAULT, EXCEPTION) REPERROR (DEFAULT2, ABEND) -- The following MAP has no exception handler, so errors cause Replicat to -- abend. MAP $DATA1.DAT.PRODUCT, TARGET PRODUCT; -- The following MAP has an exception handler, so errors will -- cause Replicat to insert problem information into the target table. MAP $DATA1.DAT.ACCOUNT, TARGET ACCOUNT; INSERTALLRECORDS MAP $DATA1.DAT.ACCOUNT, TARGET ACCOUNT_EXCEPTION, EXCEPTIONSONLY, COLMAP (ACCOUNT_NO = ACCOUNT_NO, OPTYPE = @GETENV ("LASTERR", "OPTYPE"), DBERR = @GETENV ("LASTERR", "DBERRNUM"), DBERRMSG = @GETENV ("LASTERR", "DBERRMSG"));
This example discards inserts if an error 10 is encountered.
REPERROR (10, IOTYPE, INSERT, DISCARD)
This example ignores record not found (error 11) for updates and deletes.
REPERROR (11, IOTYPE, UPDATE, DELETE, IGNORE)