Monday, June 06, 2011

Get Explain Plan From AWR

To get an explain plan from the AWR for a statement that ran in the past, use the queries below:

select *
from dba_hist_sqltext
where sql_text like '%SQL Text you are looking for%'
;

select *
from table(dbms_xplan.display_awr('<sql_id>',null,null,'ALL'))
;

No comments: