前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >18C 也不能避免 SQL 解析的 Bug

18C 也不能避免 SQL 解析的 Bug

作者头像
数据和云01
发布2019-05-26 20:50:47
7560
发布2019-05-26 20:50:47
举报
文章被收录于专栏:数据库新发现数据库新发现

1

概述

在 Oracle 12.2 版本和新发布的18.0版本中存在一个 SQL 解析的 bug,导致了数据库后台报 ora-07445 或者 ora-00600 错误。报 ora-07445 时,可导致数据库断开当前会话连接,无法进行 SQL 操作,当报 ora-00600 时,会话没有断开,但无法完成解析返回结果。

该 bug 的发现敬请参考:http://www.hellodba.com/reader.php?ID=221&lang=CN

2

触发 Bug 的现象

002.png
002.png
003.png
003.png

3

Bug 重现测试

读者可以按照以下的语句,可以在 Oracle 12.2 和18.0的版本中测试,重现这个 SQL 解析的 bug,观察报错情况。重现这个 bug 重点符合以下条件:

  1. 表中有一个运行为空的字段;
  2. 该字段的统计信息被收集过;
  3. 该字段中存在空值和非空值。

3.1 创建测试表并插入测试数据

create table tt1 (c1 number, c2 date);

insert into tt1 values(1, sysdate);

insert into tt1 values(1, null);

commit;

3.2 收集表的统计信息

exec dbms_stats.gather_table_stats('SYS', 'TT1', METHOD_OPT=>'for all columns');

3.3 尝试解析以下语句

explain plan for

with

ut as (select c1

from tt1

where nvl (c2 ,

trunc (sysdate ) ) >= trunc (sysdate ) ),

txo as (select distinct c1

from ut , dual),

u as (select * from ut)

select * from u , txo ;

读者可以按照这个测试过程,在自己的测试环境重现 ora-07445 报错,记住,决不能在生产环境的 12.2 的库上测试。

4

报错的信息追踪和影响

[oracle@susu ~]$ oerr ora 07445 07445, 00000, "exception encountered: core dump [%s] [%s] [%s] [%s] [%s] [%s]" // *Cause: An operating system exception occurred which should result in the // creation of a core file. This is an internal error.

通过服务器上看这个 ora-07445 为核心存储内部的错误。

4.1 后台日志报错

004.png
004.png

4.2 使用 adrci 工具分析

1> show incident 查看报错信息摘要:

adrci> show incident

005.png
005.png

2> 查看比较接近的一个 incident_id 的摘要详情:

adrci> show incident -mode detail -p "incident_id=155499"

006.png
006.png

4.3 语句的执行计划

这个执行计划是从 Oracle 12.1.0.2 版本中取得的,只作为参考。测试数据为根据上述条件创建的。

with

sal as (select empno,name,salary from mytest

where nvl(signdate,trunc (sysdate ) ) >= trunc (sysdate ) ),

inc as (select distinct salary from sal,dual),

mark as (select empno,name from sal)

select * from inc,mark;

Oracle 12.1中基于成本模式的 SQL 执行计划:

007.png
007.png

4.4 Oracle 官网对报错号的描写

通过 Oracle 官网文档 ORA-600/ORA-7445/ORA-700 Error Look-up Tool (Doc ID 153788.1)查看报错号对应的 bug 信息,发现官网未对 oracle 12.2 或者 18.0 这个 SQL 解析的 bug 作发布,如下:

ORA-07445: exception encountered: core dump [__intel_ssse3_rep_memcpy()+8260] in oracle 12.2.0.1 An Error document for ORA-7445 [type:] is not registered with the tool. Your request for information on this error has been recorded and will be used for publishing prioritization. Things to try: Check the error message and confirm that this is an ORA-7445 error and not an ORA-600 or ORA-700 error. Use 'Do a general Search for Knowledge' to begin a search for any published documents and bugs that mention the error.

0010.png
0010.png

由于这个 ora-07445 报错出现在之前的多个版本的不同场景,以下为12.1版本中有类似的 bug 可以参考一下:

Bug 18463985 - ORA-7445 [__intel_ssse3_rep_memcpy()+8912] for stmt with adaptive plans and cfb (Doc ID 18463985.8)

0011.png
0011.png

以及官网文档:

Bug 21856417 - Wrong Result: null values with partial join evaluation , Filter Push Down and fix for bug 18463985 (Doc ID 21856417.8)

0012.png
0012.png
0021.png
0021.png
31.png
31.png
32.png
32.png
41.png
41.png
42.png
42.png
43.png
43.png
43.png
43.png
44.png
44.png
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2018年03月06日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 3.1 创建测试表并插入测试数据
  • 3.2 收集表的统计信息
  • 3.3 尝试解析以下语句
  • 4.1 后台日志报错
  • 4.2 使用 adrci 工具分析
    • 4.3 语句的执行计划
      • 这个执行计划是从 Oracle 12.1.0.2 版本中取得的,只作为参考。测试数据为根据上述条件创建的。
      • 4.4 Oracle 官网对报错号的描写
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档