基于湖库一体架构,统一管理结构化、半结构化与非结构化等多模态数据,一个系统承载事务处理、实时分析与 AI 工作负载。
OceanBase 数据库 V4.x 版本因表索引过多导致查询物理执行计划报错 -4016 的原因及处理方法
更新时间:2026-05-22 08:56
问题现象
通过 gv$ob_plan_cache_plan_explain 查询物理执行计划失败,报错 -4016,例如。
obclient [XXX]> select * from GV$OB_PLAN_CACHE_PLAN_EXPLAIN where TENANT_ID = 1002 AND SVR_IP = 'xxx.xxx.xxx.25' AND SVR_PORT = '2882' AND plan_id = '343493';
ORA-00600: internal error code, arguments: -4016, Internal error
问题发生后 OBServer 日志中会打印关键日志信息 fail to gen property。
[2024-10-14 13:20:15.643092] WDIAG [SERVER] get_property (ob_plan_cache_plan_explain.cpp:254) [18905][T1002_L1_G10001][T1002][xxxxx-xxxxx-xxxxx-xxxxx] [lt=11][errcode=-4016] fail to gen property(ret=-4016)
问题原因
所查询的表上创建了一百多个索引,且索引名很长,索引名总长度超过了c4096c字符,gv$ob_plan_cache_plan_explain 的 property 字段使用了固定的 4096 大小的 buffer。一旦 table scan 算子的 property 需要打印的字符串超过 4096 字符,就会报错。
问题的风险及影响
无法查询 gv$ob_plan_cache_plan_explain 的 property 字段,但其他字段依然可以查询。无其他影响
影响租户
影响 OceanBase 数据库中的 SYS 租户和 Oracle 租户以及 MySQL 租户。
适用版本
OceanBase 数据库 V4.x 版本。
解决方法及规避方式
解决方法:
升级至问题已修复版本。目前已修复的版本包括 OceanBase 数据库 V4.2.5(oceanbase-4.2.5.0-100000082024102022)版本。
规避方式:
无法规避。在 OceanBase 数据库 V4.x 版本中的物理计划更建议通过
dbms_xplan.display_cursor()来查询。