@target
2014-10-08 10:40:48 WARNING OGG-00869 Oracle GoldenGate Delivery for Oracle, r_xx.prm: No unique key is defined for table 'XXXXXXXXX_HIS'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
2014-10-08 10:40:48 WARNING OGG-01431 Oracle GoldenGate Delivery for Oracle, r_xx.prm: Aborted grouped transaction on 'XXXXXXXXX_HIS', Mapping error.
2014-10-08 10:40:48 WARNING OGG-01003 Oracle GoldenGate Delivery for Oracle, r_xx.prm: Repositioning to rba 40285753 in seqno 13692.
2014-10-08 10:40:49 WARNING OGG-01151 Oracle GoldenGate Delivery for Oracle, r_xx.prm: Error mapping from XXXXXXXXX_HIS to XXXXXXXXX_HIS.
2014-10-08 10:40:49 WARNING OGG-01003 Oracle GoldenGate Delivery for Oracle, r_xx.prm: Repositioning to rba 40285753 in seqno 13692.
问题原因:
2014-10-08 10:40:48 WARNING OGG-00869 Oracle GoldenGate Delivery for Oracle, r_xx.prm: No unique key is defined for table 'XXXXXXXXX_HIS'. All viable columns will be used to represent the key, but may not guarantee uniqueness. KEYCOLS may be used to define the key.
这条报错,提醒XXXXXXXXX_HIS没有唯一键。
但是,这个表实际上有唯一键。所以,ogg的这条报错很奇怪。
metalink有提示:
Replicat Abending With Mapping Error and discard file shows Missing Key Columns (文档 ID 1276538.1)
If source table contains two unique indexes, during DDL change extract may choose and log incorrect column as primary key column which is due to bug in extract's code while sorting unique indexes, resulting in replicat process abend with missing key columns options.
文中提示,source端表有2个唯一键,抽取进程可能选择的将唯一键作为了主键(这是一个bug)。
该bug反应出的现象是,replicat进程abend,然后提示“No unique key is defined”。
解决办法:
在source和target端,问题表后面都加上keycols选项,告诉ogg真正的主键。
添加keycols参数后解决问题。
MAP XXXXXXXXX_HIS ,TARGET XXXXXXXXX_HIS , keycols(id) ;
总结:如果source端表有2个唯一键,那么一定在extract参数中用keycols参数指出主键列。
target端replicat进程参数也要用keycols参数指出主键列。
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26655292/viewspace-2122587/
,如需转载,请注明出处,否则将追究法律责任。