千家信息网

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

发表于:2025-11-07 作者:千家信息网编辑
千家信息网最后更新 2025年11月07日,OGG出现故障, ORA-01400, cannot insert null into "TEST"."TEST"目标端复制进程使用了配置HANDLECOLLISIONS, 此配置在目标端更新时,如果
千家信息网最后更新 2025年11月07日GoldenGate OGG-01004 ORA-01400 Cannot insert null into ...

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...



数据 文档 更新 配置 日志 目标 进程 附加 危险 动作 字段 手工 故障 方案 步骤 环境 解决方案 错误 同步 处理 数据库的安全要保护哪些东西 数据库安全各自的含义是什么 生产安全数据库录入 数据库的安全性及管理 数据库安全策略包含哪些 海淀数据库安全审计系统 建立农村房屋安全信息数据库 易用的数据库客户端支持安全管理 连接数据库失败ssl安全错误 数据库的锁怎样保障安全 软件开发后端主要工作 企业微信接收邮件服务器 人工智能网络技术前景 有关食品网络安全的手抄报 网络安全主持词简短 网站信息采集到数据库 星辰变网游包裹数据库文件名称 数据库缓存用什么 如何把ip地址传给服务器上 张家口科技产业互联网公司 江苏一朵云互联网科技 光纤网络技术员工作内容 普法网络安全手抄报图片 sql数据库设计及应用程序设计 自然资源数据库从哪里找 网络安全约谈记录会有影响吗 软件开发成本包括copy 河北省检察院网络安全竞赛 数据库average函数 上海蓝盟网络技术公司培训 关于无线网络安全的自查报告 梅氏字辈数据库 数据库停止怎么重新启动 月度网络安全总结 威海市网络安全信息通报中心 电信允许个人电脑作为服务器吗 软件开发之做网站行不 福建漳州dns服务器云主机 玛法里奥服务器 可以用qq支付的主题软件开发
0