ORACLE cannot fetch plan for sql_id

Source: Internet
Author: User

Today, when doing the SQL Execution Plan test, found that sqlplus can not print the execution plan normally, according to the online data collation as follows:

.....

[Email protected]> 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, the plan is no longer in cursor cache (check V$sql
_plan)


Note: The red sql_id does not exist, because Sqlplus opened the serveroutput, Tom's explanation is as follows:


Do you see the SQL it is showing-dbms_output.get_lines ....

The last SQL your session executed is in fact, Call-sqlplus does that, you had set serveroutput on


Issue WORKAROUND:

Set Serveroutput off

and try it ... Query again






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

Dylan presents.


ORACLE cannot fetch plan for sql_id

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.