错误实例:
生产环境,JAVA程序某功能报错:
ORA-00600: 内部错误代码, 参数: [qctcte1], [0], [], [], [], [], [], []
问题排查:
org.hibernate.exception.GenericJDBCException: ORA-00600: 内部错误代码, 参数: [qctcte1], [0], [], [], [], [], [], [], [], [], [], []
问题SQL语句:
select count(*)
from (select a.ID_ as id, a.SOCIAL_ORGANIZATION_NAME as name, '社会组织' as type, a.CREATE_TIME, a.X as x, a.Y as y
from SOCIAL_ORGANIZATION a
where a.DEL_FLAG = 0
union all
select a.ID_ as id, a.LEGAL_REPRESENTATIVE_NAME as name, '非公有制经济组织' as type, a.CREATE_TIME, a.X as x, a.Y as y
from NPSOE_ORGANIZATION a
where a.DEL_FLAG = 0
ORDER BY CREATE_TIME DESC) G
执行结果:

分析SQL,查找报错原因:
根据官方对于ORA-00600 [qctcte1]的解释,出错原因有可能是ORDER BY 语句,
修改ORDER BY 中的排序列,将排序列放在最后一个字段,执行通过。
修改后SQL语句:
select count(*)
from (select a.ID_ as id, a.SOCIAL_ORGANIZATION_NAME as name, '社会组织' as type, a.X as x, a.Y as y, a.CREATE_TIME
from SOCIAL_ORGANIZATION a
where a.DEL_FLAG = 0
union all
select a.ID_ as id, a.LEGAL_REPRESENTATIVE_NAME as name, '非公有制经济组织' as type, a.X as x, a.Y as y, a.CREATE_TIME
from NPSOE_ORGANIZATION a
where a.DEL_FLAG = 0
ORDER BY CREATE_TIME DESC) G
执行结果:

本文介绍了一个生产环境中遇到的JAVA程序错误ORA-00600,并详细展示了错误实例及排查过程。通过调整SQL语句中ORDER BY子句的位置,成功解决了这一问题。
36

被折叠的 条评论
为什么被折叠?



