Bob,
Reasons for what you see could be many, including: cardinality feedback, bind
peeking, dynamic sampling and changes on stats, just to mention the more common
reasons for a plan to change.
In cases like this you may want to use tools designed specifically to diagnose
SQL. If you have access to MOS you can try SQLT (215187.1) else SQLd360. The
latter is free and requires no installation. These days I use only SQLd360. Use
either, read the output, and if you cannot figure out the root cause send me
the output (if you can) and I will tell you why your plan changes.
Carlos
On Jan 18, 2017, at 10:28 AM, Stauffer, Bob <RStauffer@xxxxxxxx> wrote:
Hi all,
Oracle RDBMS EE 11.2.0.4.0 - 64bit
Red Hat Enterprise Linux 5.11
Any suggestions on how I can troubleshoot a query that performs
inconsistently? Sometimes it takes a minute to run and sometimes it takes
over an hour. It generally uses one of two explain plans – one fast and one
slow. Although it sometimes uses a different plan. I’ve checked the stats
and they are up to date. I generally run it in TOAD, but the same problem
occurs in SQLPlus, SQL Developer, and other interfaces. It doesn’t matter
whether the system is busy or quiet. And it happens within the same session
– I can run it one right after another and it will change the plan for each
execution.
Any help would be appreciated. I’m a little rusty with Oracle.
Thanks much.
Bob Stauffer
DBA/Database Developer
***CONFIDENTIALITY NOTICE***This email contains confidential information
which may also be legally privileged and which is intended only for the use
of the recipient(s) named above. If you are not the intended recipient, you
are hereby notified that forwarding or copying of this email, or the taking
of any action in reliance on its contents, may be strictly prohibited. If you
have received this email in error, please notify us immediately by reply
email and delete this message from your inbox. Thank you. E-Mail Opt Out
Notice: This e-mail message may include an advertisement. You have the right
to request that we not send future advertisements to you at this e-mail
address. If you prefer not to receive future advertisements from us at this
e-mail address, please access the following url http://www.optoutffc.com/ ;
<http://www.optoutffc.com/> Fulton Financial Corporation, P.O. Box 4887,
Lancaster, Pa. 17604