Check the execution plan for SQL from SID of AWR Report and SQL Baseline in Oracle

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.