Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

How to find historic execution plans for a sql_id

Badam123Jul 10 2018 — edited Jul 10 2018

I executed a query for first time and I got the execution plan using the below :

select * from table(dbms_xplan.display_cursor('abpbrfbuumt2p',0,'ALLSTATS LAST'));

I added a new index for a table used in the query and re-ran the query again , I then got a different execution plan for the same query.(index used now)

I was able to get the execution plan using the same query as before

select * from table(dbms_xplan.display_cursor('abpbrfbuumt2p',0,'ALLSTATS LAST'));

Now I like to see all the old execution plan for the sql_id . Just incase there are 3 different plans for the same query I like to see all the three plans.  I don't have access to OEM

Oracle version : 11.2.0.4

Note : I also get a common question saying if

Thanks in advance

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 7 2018
Added on Jul 10 2018
8 comments
17,535 views