码迷,mamicode.com
首页 > 数据库 > 详细

ORACLE cannot fetch plan for SQL_ID

时间:2014-12-30 23:39:47      阅读:303      评论:0      收藏:0      [点我收藏+]

标签:cannot fetch plan fo

今天做SQL执行计划测试的时候,发现sqlplus无法正常打印执行计划,根据网上资料整理如下:

.....

SYS@orcl> select *
  2     from table(
  3           dbms_xplan.display_cursor( format=> ‘allstats last‘ )
  4           )
  5   /


PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------
SQL_ID  9babjv8yq8ru3, child number 0


BEGIN DBMS_OUTPUT.GET_LINES(:LINES, :NUMLINES); END;


NOTE: cannot fetch plan for SQL_ID: 9babjv8yq8ru3, CHILD_NUMBER: 0
      Please verify value of SQL_ID and CHILD_NUMBER;
      It could also be that the plan is no longer in cursor cache (check v$sql
_plan)


注意: 标红的SQL_ID确实不存在,原因是SQLPLUS打开了SERVEROUTPUT ,TOM的解释如下:


do you see the sql it is showing - dbms_output.get_lines.... 

the last sql your session executed was in fact that call - sqlplus does that when you have set serveroutput on 


issue  解决方法:

set serveroutput off 

and try it...   再次查询






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

Dylan    Presents.


ORACLE cannot fetch plan for SQL_ID

标签:cannot fetch plan fo

原文地址:http://blog.csdn.net/indexman/article/details/42277207

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!