How can I see the plan of execution/explain Prev

Hi Master,

Y'day my application works very well. But today query times. I want to see the execution plan of y'day to compare the current execution plan. How can I see? Where it will store?

Please advise... !!

Concerning

AR

Hi 874273, here's a way, using DBA_HIST_SQL_PROFILE: (http://docs.oracle.com/cd/B19306_01/server.102/b14237/statviews_3179.htm#REFRN23443)

SELECT p.id,
       RPAD(' ', p.depth)||p.operation||' '||p.options operation,
       p.object_name name,
       ROUND(p.bytes/1024, 0) kbytes,
       p.cpu_cost, p.io_cost,
       p.temp_space,
       p.cardinality, p.cost,
       TO_CHAR(TRUNC(p.time/3600),'FM9900')||':'||
       TO_CHAR(TRUNC(MOD(p.time,3600)/60),'FM00')||':'||
       TO_CHAR(MOD(p.time,60),'FM00') time,
       p.timestamp
FROM   dba_hist_sql_plan p
WHERE  p.sql_id = '99a6nwhm3hjju'
ORDER BY p.plan_hash_value, p.id

You should know the sql_id (available from v$ sql, v$ sqlares. dba_hist_sqltext...)

See you soon,.

The Canada Gazette

Tags: Database

Similar Questions

Maybe you are looking for