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;
2

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

| improve this answer | |
  • Thank you! That works perfect – Mikhail Aksenov Feb 25 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 – a_horse_with_no_name Feb 25 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.