0

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

I couldn't succeed with:

select 
   DBMS_SQL_MONITOR.REPORT_SQL_MONITOR
        (sql_id=>'b3x6apqyskn7x') report
from dual;

1 Answer 1

6

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).

2
  • Thank you! That works perfect Feb 25, 2020 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
    – user1822
    Feb 25, 2020 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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