首页 > 代码库 > ORA-06512: at "SYS.XMLTYPE" 问题记录

ORA-06512: at "SYS.XMLTYPE" 问题记录

执行SQL报错:

SQL> 
SELECT COUNT(cl.enable_flg) FROM cont_ledger cl 
 INNER JOIN project_project pp ON cl.project_cd=pp.org_cd
  INNER JOIN res_approve_info rai ON rai.res_approve_info_id=cl.res_approve_id
   INNER JOIN res_approve_content rac ON rac.res_approve_info_id=rai.res_approve_info_id
  WHERE cl.enable_flg=‘1‘  AND pp.is_virtual=‘0‘
  AND cl.created_date>to_date(‘2016-01-01‘,‘yyyy-mm-dd‘)
  AND cl.created_date<to_date(‘2017-01-01‘,‘yyyy-mm-dd‘)
  8     AND EXTRACTVALUE(xmltype(rac.approve_content), ‘/templet/content/isMonopoly‘) =‘true‘;
   AND EXTRACTVALUE(xmltype(rac.approve_content), ‘/templet/content/isMonopoly‘) =‘true‘
                    *
ERROR at line 8:
ORA-27163: out of memory
ORA-06512: at "SYS.XMLTYPE", line 272
ORA-06512: at line 1


select count(cl.cont_ledger_id) from cont_ledger cl 
 inner join project_project pp on cl.project_cd=pp.org_cd
  inner join res_approve_info rai on rai.res_approve_info_id=cl.res_approve_id
   inner join res_approve_content rac on rac.res_approve_info_id=rai.res_approve_info_id
  where cl.enable_flg=‘1‘  and pp.is_virtual=‘0‘
  and cl.created_date>to_date(‘2016-01-01‘,‘yyyy-mm-dd‘)
  and cl.created_date<to_date(‘2017-01-01‘,‘yyyy-mm-dd‘)
  8     and extractvalue(xmltype(rac.approve_content), ‘/templet/content/isMonopoly‘) =‘true‘;
   and extractvalue(xmltype(rac.approve_content), ‘/templet/content/isMonopoly‘) =‘true‘
                    *
ERROR at line 8:
ORA-27163: out of memory
ORA-06512: at "SYS.XMLTYPE", line 272
ORA-06512: at line 1
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31



google到解决办法,说是11.2.0.4的一个小bug,需要设置一个事件才能避免

SQL> ALTER SESSION SET EVENTS ‘31156 trace name context forever, level 0x400‘;

Session altered.

SQL> 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 1
  • 2
  • 3
  • 4
  • 5

 

OK,可以执行成功了,如下所示:

SQL> 
select count(cl.cont_ledger_id) from cont_ledger cl 
 inner join project_project pp on cl.project_cd=pp.org_cd
  inner join res_approve_info rai on rai.res_approve_info_id=cl.res_approve_id
   inner join res_approve_content rac on rac.res_approve_info_id=rai.res_approve_info_id
  where cl.enable_flg=‘1‘  and pp.is_virtual=‘0‘
  and cl.created_date>to_date(‘2016-01-01‘,‘yyyy-mm-dd‘)
  and cl.created_date<to_date(‘2017-01-01‘,‘yyyy-mm-dd‘)
  8     and extractvalue(xmltype(rac.approve_content), ‘/templet/content/isMonopoly‘) =‘true‘;

COUNT(CL.CONT_LEDGER_ID)
------------------------
            1091

SQL> 

ORA-06512: at "SYS.XMLTYPE" 问题记录