返回顶部
首页 > 资讯 > 数据库 >GoldenGate OGG-01004 ORA-01400 Cannot insert null into ...
  • 709
分享到

GoldenGate OGG-01004 ORA-01400 Cannot insert null into ...

2024-04-02 19:04:59 709人浏览 安东尼
摘要

OGG出现故障, ORA-01400, cannot insert null into “TEST“.“TEST“ 目标端复制进程使用了配置HANDLECOLLISioNS, 此配置在目标端更新时

OGG出现故障, ORA-01400, cannot insert null into “TEST“.“TEST“
目标端复制进程使用了配置HANDLECOLLISioNS, 此配置在目标端更新时,如果更新不到数据,会将UPDATE转换成insert
但是因为源端并没有配置所有列的附加日志,所以,没有被更新的列并不会包含在insert中,从而导致错误

做了以下步骤, 这里是临时解决方案:
1. 将列修改成null: alter table test modify col1 null;
2. 启动复制进程
3. 检查数据:select count(*) from test where col1 is null (发现有八条)
4. 处理并手工同步这八条数据
5. 将字段改成not null : alter table test modify col1 not null;

最终解决: 需要加入表的所有列的附加日志: alter table test add supplemental log data (ALL) columns;
DDL操作在生产环境较为危险, 暂缓动作


MOS文档ID: Replicat Abends With Errror ORA-01400: Cannot Insert NULL Into Table for Not Null Columns When Specifying INSERTALLRECORDS (文档 ID 1994869.1)

                      REPLICAT Reports ORA-01400: Cannot Insert NULL When Using HANDLECOLLISIONS (文档 ID 1576900.1)

REPLICAT tried to UPDATE an existing row, but none was found, so due to parameter HANDLECOLLISIONS, the failed UPDATE was converted into an INSERT.
That INSERT then failed because the Trail file did not have all the columns, because the record was for an UPDATE for 5 out of 15 columns, where the table on the oracle database had the NOT NULL constraint set for all columns.

The cause of the problem has been determined from the following points;

  • The REPLICAT report shows the message "... inserting a row into USER1.TABLE1 due to missing target row for a key update operation. " 
    where the key Words are " missing target row for a key update ". 
    This means there was no row to UPDATE, for the change record found in the Trail file.
  • The REPLICAT had the HANDLECOLLISIONS parameter set.
  • The GoldenGate Reference Guide shows that when HANDLECOLLISIONS is used, failed UPDATE's will be converted into INSERT's 
    "If the row with the old key is not found in the target, the change record in the trail is converted to an insert".
  • The REPLICAT report finally shows that after the failed UPDATE was reported, the INSERT also failed.  
    The INSERT failed because the Trail file record only had 5 out of 15 columns, where the table is defined with NOT NULL on all the columns.  
    This then caused the Oracle database error: ORA-01400: cannot insert NULL...



您可能感兴趣的文档:

--结束END--

本文标题: GoldenGate OGG-01004 ORA-01400 Cannot insert null into ...

本文链接: https://lsjlt.com/news/46570.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

猜你喜欢
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作