Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: statspack

Re: statspack

From: Oradba Linux <oradba_linux_at_verizon.net>
Date: Wed, 31 Jan 2007 02:41:29 GMT
Message-ID: <tlTvh.8542$gn1.8404@trnddc06>


DA Morgan wrote:
> Oradba Linux wrote:

>> I am trying to find out the execution plan of a SQL that was executed 
>> in the database about a week back. I am using sprepsql.sql. Should i 
>> watch out for any surprises , caveats using this. I understand that 
>> the execution path about a week back will not be the same as current. 
>> I want to actually the execution path the SQL took a week back.
>> Obviously i am trying to performance tune the SQL which is behaving 
>> poorly now vs a week back.

>
> What version?
>
> With 10g, assuming no shutdown, you should be able to find the sql_id in
> gv$sql and then use that to run dbms_xplan.display_cursor.
>
> demo in Morgan's Library at www.psoug.org under DBMS_XPLAN.DISPLAY_CURSOR

I am in 9i. I can v$sql_plan to look at the current execution plan and used sprepsql.sql to report old one. Found the difference and used hints to fix it.
Since the same SQL was hard parsed and execution plan changed i was not sure if both the versions existed in v$sql_plan. Anyway in this the method and the solution worked. Received on Tue Jan 30 2007 - 20:41:29 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US