Fast SQL runs slow on identical database
Question: The same SQL runs on both servers.
Sometime the SQL runs fast(< 1 sec) and sometime the SQL response
time is slow (> 15 sec). Each server is on a different
network. The databases are about 99% the same with some minor
differences. If we open 2 sessions on the same server/database, 1
SQL session will run fast and the other SQL will run slow. Both
session are using the same execution path. Theses queries have been
running in production for over a year and have not changed.
How do I diagnose this sporadic SQL performance issue?.
Answer: When I see sporadic SQL
performance, I start by exploring whether we have a shortage of a
shared system resource, either network, RAM, disk enqueues, or CPU.
If you can witness the slow SQL, run two STATSPACK or AWR
snapshots, 5 minutes apart, and get the elapsed time report!
Then, feed the report into
http://www.statspackanalyzer.com
That will show us
EXACTLY why the SQL is slow!
I would start by monitoring the
OS environment for stress related shortages.
You can run a
daemon vmstat background process script on
Solaris, that stuffs the vmstat data into tables every 5 minutes:
Diagnose sporadic SQL response time
1 - Monitor RAM and CPU with
vmstat:
2 - Monitor for disk
enqueues with iostat:
3 - Monitor network with netstat
I'm going to bet that you will see some shared resource shortage
during the time that the SQL runs slow . . .
For a complete SQL troubleshooting methodology, see my book
Advanced Oracle SQL Tuning.
|
|
|
|
Get the Complete
Oracle SQL Tuning Information
The landmark book
"Advanced Oracle
SQL Tuning The Definitive Reference" is
filled with valuable information on Oracle SQL Tuning.
This book includes scripts and tools to hypercharge Oracle 11g
performance and you can
buy it
for 30% off directly from the publisher.
|
|
|
|
|
|
Guarantee your Success!
Oracle is the
world's most complex, robust and flexible database, considered
impossible to master without a mentor.
That's why all BC
Oracle trainers are working professionals, experts in Oracle who
share their tips and secrets. |
|
| |
|
Burleson is the American Team

Note:
This Oracle
documentation was created as a support and Oracle training reference for use by our
DBA performance tuning consulting professionals.
Feel free to ask questions on our
Oracle forum.
Verify
experience!
Anyone
considering using the services of an Oracle support expert should
independently investigate their credentials and experience, and not rely on
advertisements and self-proclaimed expertise. All legitimate Oracle experts
publish
their Oracle
qualifications.
Errata?
Oracle technology is changing and we
strive to update our BC Oracle support information. If you find an error
or have a suggestion for improving our content, we would appreciate your
feedback. Just
e-mail:
and include the URL for the page.
Copyright ? 1996 - 2011 by Burleson Enterprises
All rights reserved.
Oracle ?
is the registered trademark of Oracle Corporation.
|
|
|
|
|