【情景再现】
生产环境,JAVA程序某功能报错:
ORA-00600: 内部错误代码, 参数: [qctcte1], [0], [], [], [], [], [], []
【问题排查】
1.检查Oracle的alert日志,发现如下行:
Tue Sep 17 17:11:04 2013
Errors in file /oracle/admin/kyy/udump/kyy_ora_5613.trc:
ORA-00600: 内部错误代码, 参数: [qctcte1], [0], [], [], [], [], [], []
2.继续追踪kyy_ora_5613.trc,发现如下行:
*** 2013-09-17 17:11:04.712
ksedmp: internal or fatal error
ORA-00600: 内部错误代码, 参数: [qctcte1], [0], [], [], [], [], [], []
Current SQL statement for this session:
select …… from …… ORDER BY ……
3.在开发环境和生产环境测试问题SQL:
/* Formatted on 2013/09/25 10:42 (Formatter Plus v4.8.8) */
SELECT a.formid, flowtempletno, laststep, waitrunsetp, status,
lastoperperson, lastopertime, createpersonid, createpersonname,
createtime, lastmodifypersonid, lastmodifytime, infodep
FROM bg_forminfo a
WHERE moduleno = :1
AND formid IN (
SELECT DISTINCT a.formid
FROM bg_forminfo a,
bg_flowstep b,
v_bg_flowuser d,
bg_flowtemplet e
WHERE a.status = :2
AND e.moduleno = :3
AND a.flowtempletno = e.flowtempletno
AND a.formid = b.formid
AND b.stepno = a.waitrunsetp
AND b.roleno = d.roleno
AND b.managescope = d.managescope
AND d.personid = :4
AND a.waitrunsetp != 1)
ORDER BY (SELECT columvalue
FROM bg_forminfodetail b
WHERE formid = a.formid AND columnen = 'gds_ycsj') DESC,
(SELECT columvalue
FROM bg_forminfodetail b
WHERE formid = a.formid AND columnen = 'gds_lxrxm')
结果如下:
Oracle版本 | OS版本 | 执行结果 |
Oracle 10.2.0.1 64bit | CentOS 5.3 64bit | PASS |
Oracle 10.2.0.4 32bit | Windows 2003 Enterprise 32bit | PASS |
Oracle 10.2.0.4 64bit | Ignite-UX revision C.7.9.254 (ia64 hp server rx6600) | ERROR |
4.分析SQL,查找报错原因:
根据官方对于ORA-00600 [qctcte1]的解释,出错原因有可能是ORDER BY 语句,
修改ORDER BY 中的排序列,执行通过。
【问题回顾】
遇到ORA-00600问题,
开始以为Oracle的参数设置有误,对比开发和生产数据库的版本和参数未发现问题(cursor_sharing);
接着怀疑程序连接数据库的classes12.jar,生产和开发使用的都是10.2.0.1版本的classes12.jar,
最后根据Oracle官方解释,问题定位在SQL的ORDER BY中。
【参考资料】
ORA-00600: internal error code, arguments: [string], [string], [string], [string], [string], [string], [string], [string]
Cause: This is the generic internal error number for Oracle program exceptions.
This indicates that a process has encountered an exceptional condition.
Action: Report as a bug - the first argument is the internal error number
ERROR: ORA-600 [qctcte1] [a]
VERSIONS: versions 9.1 to 11.1
DESCRIPTION: Inconsistent datatype is reported during typechecking when parsing a query.
ARGUMENTS: Arg [a] Current data type FUNCTIONALITY: Query Compile Typecheck
IMPACT: PROCESS FAILURE NON CORRUPTIVE - No underlying data corruption.
SUGGESTIONS: If the Known Issues section below does not help in terms of identifying a solution,
please submit the trace files and alert.log to Oracle Support Services for further analysis.
Known Issues:
Bug# 8541212
See Note 8541212.8 OERI [qctcte1] with function based index and OLD style join push predicate
Fixed: 11.2
Bug# 7476591
See Note 7476591.8 OERI[qctcte1] / dump (evaopn2) from SQL with correlated subquery
Fixed: 10.2.0.5, 11.2
Bug# 6815733
See Note 6815733.8 OERI [qctcte1] from cost based transformation with subquery in ORDER BY clause
Fixed: 10.2.0.5, 11.2, 10.2.0.3.P23, 10.2.0.4.P01, 11.1.0.6.P12, 11.1.0.7.P01
Bug# 6609623
See Note 6609623.8 OERI:qctcte1 from CONNECT BY query with "ORDER SIBLINGS BY" clause
Fixed: 10.2.0.5, 11.2
Bug# 6316585
See Note 6316585.8 Dump / OERI from complex view merging
Fixed: 10.2.0.5, 11.1.0.7, 10.2.0.3.P19, 10.2.0.3.P26
Bug# 6145570
See Note 6145570.8 Wrong results / OERI from LIKE with join predicate pushdown
Fixed: 10.2.0.5, 11.1.0.7, 10.2.0.3.P11, 11.1.0.6.P01
Bug# 6075238
See Note 6075238.8 OERI[qctcte1] on parse of query with views / subqueries
Fixed: 10.2.0.4, 11.1.0.7, 11.2
Bug# 6061623
See Note 6061623.8 OERI:qctcte1 from cost based transformation of INSERT as SELECT with TO_LOB
Fixed: 10.2.0.5, 11.1.0.7, 11.2, 10.2.0.3.P13
Bug# 6047490
See Note 6047490.8 ORA-932 / OERI:qctcte1 using CONNECT_BY_ROOT
Fixed: 10.2.0.5, 11.2, 10.2.0.4.P15
Bug# 6012053
See Note 6012053.8 OERI [qctcte1] from GROUPING SETs query
Fixed: 10.2.0.4, 11.1.0.6, 10.2.0.3.P18
Bug# 5617382
See Note 5617382.8 OERI[qctcte1] with the fix from Bug 5259868
Fixed: 10.2.0.4, 11.1.0.6
Bug# 5395270
See Note 5395270.8 OERI[qctcte1] / dump / wrong results from view merging
Fixed: 10.2.0.4, 11.1.0.6, 10.2.0.3.P15
Bug# 5382842
See Note 5382842.8 Select fails with OERI[qctcte1] using cost based transformation
Fixed: 10.2.0.4, 11.1.0.6, 10.2.0.2.P09, 10.2.0.3.P05
Bug# 5371149
See Note 5371149.8 OERI[qctcte1] from query with CONNECT BY
Fixed: 10.2.0.4, 11.1.0.6, 10.2.0.2.P10, 10.2.0.3.P05
Bug# 4735795
See Note 4735795.8 OERI:qctcte1 with UNION in an "and exists" subselect
Fixed: 10.2.0.3, 11.1.0.6
Bug# 3963092
See Note 3963092.8 OERI[qctcte1] compiling SQL with ORDER BY .. DESC
Fixed: 10.1.0.4, 10.2.0.1
Bug# 3730166
See Note 3730166.8 OERI [qctcte1] / [kghssgcop2] from ANSI outer joins with binds
Fixed: 10.1.0.5, 10.2.0.1
Bug# 3557906
See Note 3557906.8 OERI[qctcte1] from predicate move around
Fixed: 9.2.0.6, 10.1.0.4, 10.2.0.1
Bug# 3216046
See Note 3216046.8 OERI:qctcte1 running a query with a subquery in SELECT list
Fixed: 9.2.0.5, 10.1.0.2
Bug# 3121670
See Note 3121670.8 OERI:qctcte1 can occur on VIEW with HAVING clause with STAR transformation
Fixed: 9.2.0.5, 10.1.0.2
Bug# 3110923
See Note 3110923.8 Dump (in qmxtrxopt) using ORDER BY .. DESC on a CONSTANT column
Fixed: 9.2.0.5
Bug# 2458655
See Note 2458655.8 OERI[QCTCTE1] from FULL OUTER JOIN with BIND variable in subquery
Fixed: 9.2.0.3, 10.1.0.2
Bug# 2357784
See Note 2357784.8 OERI[QCTCTE1] parsing ANSI OUTER JOIN with a VIEW with a SET operation (eg: UNION ALL)
Fixed: 9.2.0.2
Bug# 2105452
See Note 2105452.8 OERI:QCTCTE1 possible from inline UNION view with binds
Fixed: 9.0.1.4, 9.2.0.1
Bug# 2100837
See Note 2100837.8 OERI:QCTCTE1 possible using INLIST predicates
Fixed: 9.0.1.3, 9.2.0.1
Bug# 2092554
See Note 2092554.8 OERI:qctcte1 / ORA-979 from multi-hierarchy query using materialized view
Fixed: 9.0.1.3, 9.2.0.1
Bug# 1970507
See Note 1970507.8 OERI:18096 from OUTER JOIN in MERGE USING clause in PLSQL
Fixed: 9.0.1.2, 9.2.0.1