Here’s an example of an update statement failing on the target database on a table without a primary or unique key.
Since there are no keys defined on the table, the replicat will consider all the columns as key columns.
The update statement that was processed by the extract only logged the column values that were changed along with the columns defined by the keycols parameter in the table statement, in this case the objectid column.
The replicat ABENDed since it did not have values for allt he columns. Here’s the discard file which show the specifics on the columns and the error message.
Oracle GoldenGate Delivery for Oracle process started, group RWPC discard file opened: 2013-09-08 11:21:51 Key column ROV_RNAME (354) is missing from update on table WPC.WPCTBL Key column A_RCPT_DATE (355) is missing from update on table WPC.WPCTBL Key column A_SCAN_TIME (356) is missing from update on table WPC.WPCTBL Key column DOCTYPE (357) is missing from update on table WPC.WPCTBL Key column ORIGDATE (358) is missing from update on table WPC.WPCTBL Key column STRACKING (359) is missing from update on table WPC.WPCTBL Key column M_IND (360) is missing from update on table WPC.WPCTBL Key column NCOB (361) is missing from update on table WPC.WPCTBL Key column RET_CBT (362) is missing from update on table WPC.WPCTBL Key column M_COUNTER (363) is missing from update on table WPC.WPCTBL Key column IS_DOC (364) is missing from update on table WPC.WPCTBL Missing 11 key columns in update for table WPC.WPCTBL. Current time: 2013-09-08 11:21:53 Discarded record from action ABEND on error 0 Aborting transaction on /u01/app/oracle/product/golden_gate/dirdat/wP beginning at seqno 76 rba 695700 error at seqno 76 rba 973932 Problem replicating WPC.WPCTBL to WPC.WPCTBL Mapping problem with compressed update record (target format)... * CATEGORYID = 3000 OBJECTID = 1892683845
Doing some research on My Oracle Support turned up the following two notes that were used to come up with a solution.
Replicat Abending With Mapping Error and discard file shows Missing Key Columns (Doc ID 1276538.1)
Can I Use A Wildcard In For All Of The Tables Except One so that I may describe it separately? (Doc ID 970419.1)
Two parameters were put in the replicat parameter file to workaround the issue.
DYNAMICRESOLUTION - enables fast process startup when there are numerous tables specified in TABLE or MAP statements WILDCARDRESOLVE IMMEDIATE - objects are processed at startup
Here’s a snippet of the replicat parameter file with the new mappings. The replicat is able to process the transaction after the change since the KEYCOLS parameter specified objectid to be the table’s key column. Hence, GG updates the columns in the trail, leaving those mentioned before in the discard file unchanged.
> cat rwpc.prm REPLICAT rwpc ... -- ------------------------------------------------------------------ -- mappings -- ------------------------------------------------------------------ WILDCARDRESOLVE IMMEDIATE MAP WPC.WPCTBL, TARGET WPC.WPCTBL, KEYCOLS (objectid); DYNAMICRESOLUTION MAPEXCLUDE WPC.WPCTBL; MAP WPC.*, TARGET WPC.*;