Get oracle execution plan by sql_id

execution-planoracle

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;

Best Answer

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