Solved

SQL performance tuning

Posted on 2013-01-10
3
518 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 77

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

830 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