Solved

SQL performance tuning

Posted on 2013-01-10
3
517 Views
Last Modified: 2013-01-10
What are the key steps to address the slow running SQL query in Oracle 11gr2.
Where to begin with , what should be the typical steps to find the root cause?
0
Comment
Question by:taaz
3 Comments
 
LVL 22

Accepted Solution

by:
Steve Wales earned 500 total points
ID: 38764148
One of the first things you could look at is the execution plan

See the Oracle Documentation for how to gather that information:

http://docs.oracle.com/cd/E11882_01/server.112/e16638/ex_plan.htm

Then there's some other reference sites:

http://www.oracle-base.com/articles/8i/explain-plan-usage.php
http://www.adp-gmbh.ch/ora/explainplan.html

For formatting the output in a nice, understandable way, there's DBMS_XPLAN

http://docs.oracle.com/cd/E11882_01/server.112/e16638/ex_plan.htm
http://www.oracle-base.com/articles/9i/dbms_xplan.php

Gathering your plan data is the first step.

Interpreting the data that you get is a whole other animal, but start with the above.
0
 
LVL 76

Expert Comment

by:slightwv (䄆 Netminder)
ID: 38764150
First make sure your statistics are up to date and generate an explain plan.

Look for obvious things like full table scans that you don't think should be there.

If this is a large query with a lot of sub selects, generate explain plans for them individually (break it down into smaller pieces).

If none of that helps, you can trace the session and use tkprof to look at the execution in much greater detail.

Then you can look at the possibility of things like hot blocks in the tablespace.  Possibly look at ways to redesign things.  Possible move some tables to a different tablespace with a different block size, move them to different disks, etc...
0
 

Author Closing Comment

by:taaz
ID: 38764318
Thanks for the quick reply.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Convert Oracle data into XML document 2 65
Oracle RAC 12c 8 72
grouping on time windows 6 51
Oracle DBLINKS From 11g to 8i 3 31
Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question