首批通过分布式安全可靠测评,为关键业务系统打造
Comment for field is too long (max = 4000) 报错原因
更新时间:2024-03-15 05:21
问题描述
给字段新增一段超长注释,报错。但是通过 OMS 从 Oracle 迁移,表结构同步正常,OceanBase 数据库为 GBK 租户。
ORA-00600: internal error code, arguments: -4230, Comment for field is too long (max = 4000)
适用版本
OceanBase 数据库 V2.x 和 V3.x 版本。
问题原因
在 OceanBase 数据库中,限制为 max_oracle_comment_length = 4000。在 utf-8 编码下,超过 4000,在 GBK 编码下小于 4000,Oracle 为 GBK 字符集,所以可以成功迁移。 已解决
解决方法
通过 jdbc 连接数据库,在连接串中增加 characterEncoding=gbk。
修改终端为 gbk 字符集后,通过 client 登陆数据库,执行 set names gbk 后,可以正常添加注释。