Search notes:

DBMS_XPLAN - error message: cannot fetch plan for …

When using dbms_xplan in SQL*Plus and serveroutput is enabled, an error message as shown below will be thrown:
NOTE: cannot fetch plan for SQL_ID: 9babjv8yq8ru3, CHILD_NUMBER: 1
      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)
Of course, the tip to check v$sql_plan is misleading in that case. The error message can be turned of with a
SQL> set serveroutput off

Index