ORA-07445: exception encountered: core dump [evaopn2()+2628]

本文记录了在执行Oracle存储过程时遇到的ORA-03113和ORA-07445异常现象及解决过程。通过调整SQL语句避免使用特定功能索引,成功解决了异常断开连接的问题。

os version: linux
oracle version: oracle 9204
-----------------------------------------------------------------------------------------

When I execute a sql in procedure ,It disconnect. It’s amazing.see that:

SQL> conn ngcc_best/ngcc_Best@zxin_116

已连接。

SQL> var v_i number;

SQL> exec pro_auto_IsInBefore_te1('18999912345',:v_i);

BEGIN pro_auto_IsInBefore_te1('18999912345',:v_i); END;

 

*

1 行出现错误:

ORA-03113: 通信通道的文件结束

 

Actually, the result is 1 .the detail content of procedure “pro_auto_IsInBefore_te1” is that:

create or replace procedure pro_auto_IsInBefore_te1

(

       p_strcallingno   IN    varchar2,      --主叫号码 号段部分3-15位才能匹配有效

       p_IsIn           OUT    integer        --标志

)

as

v_count   integer;

Begin

    select count(1) into v_count from

    (

     select strdhhm from t_auto_customerjudge

      where ltrim(p_strcallingno, '0') = ltrim(strdhhm, '0')

        and  type = '1'

        and (sysdate - dtjudgedate) * 1440 <= inthmdlimit

        and inthmdflag = 1

     union all

     SELECT strdhhm from t_auto_customerjudge a where

                 (

                   substr(ltrim(p_strcallingno, '0'), 1, 3) = ltrim(strdhhm, '0')

                   or

                   substr(ltrim(p_strcallingno, '0'), 1, 4) = ltrim(strdhhm, '0')

                 )

                 and type = '2'

                 and (sysdate - dtjudgedate) * 1440 <= inthmdlimit

                 and inthmdflag = 1

     );

 

    if v_count = 0 then

        p_IsIn:=0;

    else

        p_IsIn:=1;

    end if;

End ;

/

Table t_auto_customerjudge has a function index.The definition of the index is that:

create index IND_AUTO_CUSTOMERJUDGE_LTRIM on T_AUTO_CUSTOMERJUDGE (LTRIM(STRDHHM,'0'))  tablespace TSP_NGCC_BEST;

 Table has been analyzed.if you execute the statement independed of the procedure.it do well.

------------------------------------------------------------------------------------------

SQL>  select count(1) from

  2      (

  3       select strdhhm from t_auto_customerjudge

  4        where ltrim('18999912345', '0') = ltrim(strdhhm, '0')

  5          and  type = '1'

  6          and (sysdate - dtjudgedate) * 1440 <= inthmdlimit

  7          and inthmdflag = 1

  8       union all

  9       SELECT strdhhm from t_auto_customerjudge a where

 10                   (

 11                     substr(ltrim('18999912345', '0'), 1, 3) = ltrim(strdhhm,

 '0')

 12                     or

 13                     substr(ltrim('18999912345', '0'), 1, 4) = ltrim(strdhhm,

 '0')

 14                   )

 15                   and type = '2'

 16                   and (sysdate - dtjudgedate) * 1440 <= inthmdlimit

 17                   and inthmdflag = 1

 18       );

 

  COUNT(1)

----------

         0

So,why this happen?

When I check the alert.log,I found that message:

Thu Sep  9 17:56:42 2010

Errors in file /home/oracle/zxindbf/admin/zxin/udump/zxin_ora_2508.trc:

ORA-07445: exception encountered: core dump [evaopn2()+2628] [SIGSEGV] [Address not mapped to object] [0x0] [] []

Thu Sep  9 21:55:12 2010

Errors in file /home/oracle/zxindbf/admin/zxin/udump/zxin_ora_5393.trc:

ORA-07445: exception encountered: core dump [evaopn2()+2628] [SIGSEGV] [Address not mapped to object] [0x0] [] []

Thu Sep  9 21:56:59 2010

Errors in file /home/oracle/zxindbf/admin/zxin/udump/zxin_ora_5437.trc:

ORA-07445: exception encountered: core dump [evaopn2()+2628] [SIGSEGV] [Address not mapped to object] [0x0] [] []

Thu Sep  9 22:01:22 2010

Errors in file /home/oracle/zxindbf/admin/zxin/udump/zxin_ora_5557.trc:

ORA-07445: exception encountered: core dump [evaopn2()+2628] [SIGSEGV] [Address not mapped to object] [0x0] [] []

Thu Sep  9 22:02:36 2010

Errors in file /home/oracle/zxindbf/admin/zxin/udump/zxin_ora_5645.trc:

ORA-07445: exception encountered: core dump [evaopn2()+2628] [SIGSEGV] [Address not mapped to object] [0x0] [] []

It seems that when I execute the procedure “pro_auto_IsInBefore_te1”,the error 07445 will generate.

Then I check the trace file  /home/oracle/zxindbf/admin/zxin/udump/zxin_ora_5557.trc:

the important information is that:

-------------------------------------------------------------------------------------------------------

ksedmp: internal or fatal error

ORA-07445: exception encountered: core dump [evaopn2()+2628] [SIGSEGV] [Address not mapped to object] [0x0] [] []

Current SQL statement for this session:

SELECT count(1) from

    (

     select strdhhm from t_auto_customerjudge

      where ltrim(:b1, '0') = ltrim(strdhhm, '0')

        and  type = '1'

        and (sysdate - dtjudgedate) * 1440 <= inthmdlimit

        and inthmdflag = 1

     union all

     select strdhhm from t_auto_customerjudge where

                 (

                   substr(ltrim(:b1, '0'), 1, 3) = ltrim(strdhhm, '0')

                   or

                   substr(ltrim(:b1, '0'), 1, 4) = ltrim(strdhhm, '0')

                 )

                 and type = '2'

                 and (sysdate - dtjudgedate) * 1440 <= inthmdlimit

                 and inthmdflag = 1

     )

----- PL/SQL Call Stack -----

  object      line  object

  handle    number  name

0xa3d1627c         9  procedure NGCC_BEST.PRO_AUTO_ISINBEFORE_TE

0xa5b6cd5c         1  anonymous block

So,this sql in procedure makes the error 07455.how It make the error?

After some test,I found that when the function index is in use in the subquery statement:

select strdhhm from t_auto_customerjudge where

                 (

                   substr(ltrim(:b1, '0'), 1, 3) = ltrim(strdhhm, '0')

                   or

                   substr(ltrim(:b1, '0'), 1, 4) = ltrim(strdhhm, '0')

                 )

                 and type = '2'

                 and (sysdate - dtjudgedate) * 1440 <= inthmdlimit

                 and inthmdflag = 1

     )

It will makes the error.and if the subquery goes “table access full”,the error does not hppend.

Metalink says this may be a bug.But, when we consider a error is a bug,you must make sure that this error happen very common,and creating SR is a good Idea.

So,I change the sql in the procedure.like that :

-------------------------------------------------------------------------

create or replace procedure pro_auto_IsInBefore_te1

(

       p_strcallingno   IN    varchar2,      --主叫号码 号段部分3-15位才能匹配有效

       p_IsIn           OUT    integer        --标志

)

as

v_count   integer;

Begin

    select count(1) into v_count from

    (

     select strdhhm from t_auto_customerjudge

      where ltrim(p_strcallingno, '0') = ltrim(strdhhm, '0')

        and  type = '1'

        and (sysdate - dtjudgedate) * 1440 <= inthmdlimit

        and inthmdflag = 1

     union all

     SELECT strdhhm from t_auto_customerjudge a where

                 (

                     ltrim(strdhhm, '0') IN (substr(ltrim(p_strcallingno, '0'), 1, 3),

                                       substr(ltrim(p_strcallingno, '0'), 1, 4))

                 )

                 and type = '2'

                 and (sysdate - dtjudgedate) * 1440 <= inthmdlimit

                 and inthmdflag = 1

     );

 

    if v_count = 0 then

        p_IsIn:=0;

    else

        p_IsIn:=1;

    end if;

End ;

 

Now ,It goes well.

 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14730395/viewspace-673111/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/14730395/viewspace-673111/

ORA-07445 错误表明 Oracle 数据库在执行过程中遇到了严重的异常,导致核心转储(core dump)。具体错误信息 `exception encountered: core dump [qecsel] [SIGSEGV] [Address not mapped to object]` 表示数据库进程尝试访问一个未映射到其地址空间的内存地址,从而引发段错误(Segmentation Fault)[^3]。 ### 原因分析 1. **内存访问越界** 该错误通常由数据库内部组件访问非法内存地址引起。例如,在 SQL 解析或执行阶段,某些函数如 `qecsel`(用于选择操作的优化器组件)可能引用了未正确分配或释放的内存区域。 2. **SQL 语句问题** 特定的 SQL 查询结构可能导致优化器在生成执行计划时出现异常。复杂的子查询、视图合并、或者使用特定提示(hint)都可能触发此问题。 3. **Oracle 软件缺陷** 某些版本的 Oracle 存在已知的 bug,与特定模块(如 `qecsel`)相关,可能在处理特定 SQL 或数据结构时导致崩溃。 4. **内存不足或配置不当** 如果系统内存资源紧张,或者 SGA/PGA 配置不合理,也可能导致此类内存访问错误。 5. **操作系统兼容性或补丁缺失** 不兼容的操作系统版本、内核参数设置不当,或缺少关键补丁,也可能影响 Oracle 进程的稳定性。 --- ### 解决方案 #### 1. 收集诊断信息 - 查看对应的跟踪文件(trace file),路径通常记录在 alert log 中。 - 使用 `adrci` 工具分析 incident 并提取详细堆栈信息: ```bash adrci show home set home diag/rdbms/<dbname>/<instance> show incident ``` #### 2. 分析 SQL 语句 - 定位触发错误的 SQL 语句,检查是否包含复杂嵌套、不常见的语法结构或 hint。 - 尝试简化查询逻辑或禁用部分优化器特性(如 `_optimizer_unnest_sq` 等参数)进行测试。 #### 3. 应用补丁 - 检查 Oracle 官方支持文档 ID 1288518.1 和其他相关 Note,确认是否存在适用于当前版本的补丁。 - 使用 OPatch 工具安装 CPU 或 PSU 更新以修复潜在缺陷。 #### 4. 修改初始化参数 - 调整以下参数可能有助于规避问题: - `OPTIMIZER_FEATURES_ENABLE`:尝试回退到更早版本的行为。 - `_OPTIMIZER_UNNEST_SQ`:关闭子查询解嵌套功能。 - `QUERY_REWRITE_ENABLED`:禁用查询重写。 #### 5. 升级数据库版本 - 如果问题由已知缺陷引起,考虑升级到更高版本(如从 11.2.0.3 升级到 11.2.0.4 或 12c 及以上)。 #### 6. 检查操作系统环境 - 确保内核参数(如 `shmmax`, `shmall`, `ulimit`)配置合理。 - 更新操作系统并安装最新补丁。 --- ### 技术文档参考 - Oracle Support 文档:[ORA-07445 [qecsel] When Running a Query (Doc ID 1288518.1)](https://support.oracle.com/epmos/faces/ui/km/DocumentDisplay.jspx?id=1288518.1) 提供了针对该错误的具体案例和修复建议[^3]。 - Metalink Note: ORA-07445 in qecsel / qeaeo / qkexr — 常见于优化器组件中,建议检查 SQL 结构并应用相应补丁。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值