Hello Experts,
Today I had an issue for slow running query for one of our warehouse database, where tables and indexes has latest stats yesterday no new data load, "dbms_xplan.display_awr" lists multiple explain plans and the query is using a same plan generated sometime back on 2014, however a latest plan also do exists which was generated on Aug/2015. Query was same with no change.
The same query ran fine yesterday but slow today. Is any one aware if we do have any option like how to check what execution plan the query used yesterday or since some days back ?
Kindly share your views here, thanks in advance.
Find out SQL id fo that query and using the query to find out query plan with timings, select SQL_ID,PLAN_HASH_VALUE, OPERATION, COST, TIMESTAMP from DBA_HIST_SQL_PLAN where SQL_ID='g9ks2772vgzdy'
Select SAMPLE_TIME,SESSION_ID,SQL_PLAN_HASH_VALUE from DBA_HIST_ACTIVE_SESS_HISTORY where SQL_ID='9hha8mvkmmjfd' order by 1;