First, you need to report errors instead of letting the process abend.  You can use the REPTERROR parameter, which allows you to report the error and define how the errors should be handled. The followings are some examples.
- REPERROR (DEFAULT, EXCEPTION)
The DEFAULT argument sets a global response to all errors except those for which explicit REPERROR statements are specified.
- REPERROR (DEFAULT2, ABEND)
The DEFAULT2 argument specifies a "catch all" action for any unanticipated Oracle errors that may occur.
- REPERROR (-1, EXCEPTION)
ORA-00001: unique constraint violated error using an exception handler specified. The example ignores the duplicate error for Oracle database replication.
- REPERROR(1062, IGNORE)
In MySQL, the duplicate record error is 1062. the example, will ignore the duplicate error for MySQL replication.
- ORA-01403: "no data found" error.
To handle errors, the best practices is to create an exception table in Oracle GoldenGate administration schedule to track them. The following is an example. The configuration takes several steps.
Step 1: Creating exception table
In the following example, we create an exception table under a ggadm user within a PDB so that application can manage the exceptions by itself.