Is it possible to get an execution plan of currently running query by sql_id?

I couldn't succeed with:

        (sql_id=>'b3x6apqyskn7x') report
from dual;

select * from table(dbms_xplan.display_cursor('sql_id', child_number));

You can find sql_id and child_number in V$SESSION (sql_id and sql_child_number columns).

  • Thank you! That works perfect Feb 25 '20 at 11:44
  • 1
    @MikhailAksenov: you can also pass null for the child_numbeer. In that case you will get the plans for all children Feb 25 '20 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.