Get the execution plan for SQL query from AWR Report SID and SQL Plan Baseline in Oracle
Check the Execution plan of SQLID from AWR Report
set lines 200 pages 200
SELECT * FROM table(DBMS_XPLAN.DISPLAY_AWR('&sql_id'));
Check the Execution plan from the SQL Baseline in Oracle
SELECT * FROM
TABLE(DBMS_XPLAN.display_sql_plan_baseline(plan_name=>'SQL_BASELINE_NAME'));
Check the Execution plan from SQL Query
EXPLAIN PLAN for select * from hr.employees;
-- View explain plan
set line 200 pages 200
select * from table(dbms_xplan.display);
or
@?\rdbms\admin\utlxpls.sql;
Check execution plan from SQL ID Cursor
select sql_id,child_number,plan_hash_value from gv$sql where sql_id='7ne6781xgb2nm';
SQL_ID CHILD_NUMBER PLAN_HASH_VALUE
------------- ------------ ---------------
7ne6781xgb2nm 1 34243454
--- Get the explain plan for cursor:
SELECT * from TABLE(DBMS_XPLAN.DISPLAY_CURSOR('&sqlid',&child_number));