GoldenGate

How to Resolve ORA-00001, ORA-01403 in GoldenGate

Found errors in REPLICAT and caused it stopped.
GGSCI (target) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    ABENDED     ERPAPP_R    00:00:13      53:34:02


GGSCI (target) 2> view report ERPAPP_R
...
2017-05-24 23:12:11  WARNING OGG-00869  OCI Error ORA-00001: unique constraint (HR.EMPLOYEES_PK) violated (status = 1), SQL <INSERT INTO "HR"."EMPLOYEES" (...) VALUES (...)>.

2017-05-24 23:12:11  WARNING OGG-01004  Aborted grouped transaction on 'HR.EMPLOYEES', Database error 1 (OCI Error ORA-00001: unique constraint (HR.EMPLOYEES_PK) violated (status = 1), SQL <INSERT INTO "HR"."EMPLOYEES" (...) VALUES (...)>).

2017-05-24 23:12:11  WARNING OGG-01003  Repositioning to rba 3495814 in seqno 384.

2017-05-24 23:12:11  WARNING OGG-01154  SQL error 1 mapping HR.EMPLOYEES to HR.EMPLOYEES OCI Error ORA-00001: unique constraint (HR.EMPLOYEES_PK) violated (status = 1), SQL <INSERT INTO "HR"."EMPLOYEES" (...) VALUES (...)>.

2017-05-24 23:12:11  WARNING OGG-01003  Repositioning to rba 3495814 in seqno 384.
...
2017-05-24 23:12:11  ERROR   OGG-01296  Error mapping from HR.EMPLOYEES to HR.EMPLOYEES.
...

Oh, there’s a row that already exist in the target database. For skipping doubted statements, I added some conditions in REPLICAT parameter file.
GGSCI (target) 3> edit params ERPAPP_R

...
dboptions suppresstriggers
reperror (0001, discard)
reperror (1403, discard)

ddl include mapped
map hr.*, target hr.*;

GGSCI (target) 4> start ERPAPP_R

Sending START request to MANAGER ...
REPLICAT ERPAPP_R starting


GGSCI (target) 5> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING
REPLICAT    RUNNING     ERPAPP_R    00:00:00      00:00:02

In the above, I told REPLICAT to skip ORA-00001 and ORA-01403 in the target database for avoiding obvious logic conflicts in the future.

As you can see, DML errors use discard to get around. On the other side, DDL errors use ignore to solve.

Leave a Reply

Your email address will not be published. Required fields are marked *