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