OPT_PARAM Hint saves the day…

一个工程师使用嵌套子查询执行删除操作,抛出ORA-00600错误。在MOS查阅工具上显示这个错误是由此Bug引起的:

 

Bug 16347248  ORA-600 [kkqjpdGetContext:1] parsing SQL with subquery

 

这个Bug提供的解决办法是执行ALTER SESSION命令。

 

alter session set "_optimizer_unnest_disjunctive_subq"= FALSE;


 

相比改变全局会话,我们使用OPT_PARAMHint,编写像下述的子查询:

 

(SELECT /*+ OPT_PARAM('_optimizer_unnest_disjunctive_subq' 'FALSE') */ ... FROM ...)


 

发表评论提醒我们在11.2.0.4或者12c上删除Hint,工作愉快。

 

加油。

 

One of the developers was performing a delete using a nested subquery, which was throwing outORA-00600 errors. The ORA-00600 LookupTool on MOS suggested it was caused by this bug:
Bug 14347248 ORA-600 [kkqjpdGetContext:1] parsing SQL with subquery
The workaround in the bug suggested running this ALTER SESSION command.
alter session set "_optimizer_unnest_disjunctive_subq"= FALSE;
Rather than alter the whole session, we used the OPT_PARAM hint, making the subquery look something like this.(SELECT /*+ OPT_PARAM('_optimizer_unnest_disjunctive_subq' 'FALSE') */ ... FROM ...)
Slap in a comment reminding us to remove the hint when we move to 11.2.0.4 or 12c and job’s a good’un!
Cheers
Tim…

OPT_PARAM Hint saves the day…

 

 

OPT_PARAM Hint saves the day…_第1张图片 OPT_PARAM Hint saves the day…_第2张图片   OPT_PARAM Hint saves the day…_第3张图片
@Wentasy 博文仅供参考,欢迎大家来访。如有错误之处,希望批评指正。原创博文如需转载请注明出处,谢谢 :) [CSDN博客]

你可能感兴趣的:(oracle,hint,OPT_PARAM)