Solved

The Oracle top ten slowest query

Posted on 2013-06-10
12
686 Views
Last Modified: 2013-08-01
DEAR all,

 in MS SQL server, we can find out the top 10 slowest query and then start to tune it one by one in order to make the slowest query faster.

  What is teh script for Oracle to find out:
1) top 10 slowest query.
2) Top 10 slowest store procedure.
3) top 10 most busy index?
0
Comment
Question by:marrowyung
  • 4
  • 4
  • 2
  • +1
12 Comments
 
LVL 29

Expert Comment

by:MikeOM_DBA
Comment Utility
Just run AWR report.
:p
0
 
LVL 29

Assisted Solution

by:MikeOM_DBA
MikeOM_DBA earned 100 total points
Comment Utility
Or...check out if you can use one of these scripts.
0
 
LVL 48

Accepted Solution

by:
PortletPaul earned 200 total points
Comment Utility
If licensed for it the Performance Pack has many tools for performance tuning.

If you aren't licensed for it use the statspack.

(Oracle  10g and later) AWR reports, see:
http://docs.oracle.com/cd/B19306_01/server.102/b14211/autostat.htm#PFGRF027

(to start a snashot for the AWR report you need:
with execute privilege on package dbms_workload_repository.
execute dbms_workload_repository.create_snapshot('TYPICAL');
parameter (default) is ‘TYPICAL’  - can be  ‘ALL’)

For earlier Oracle versions, or without performance pack, use statspack
http://docs.oracle.com/cd/B19306_01/server.102/b14211/autostat.htm#PFGRF027

Other potentially useful resources:
http://www.oraperf.com/ (Upload your utlbstat/utlestat or STATSPACK file and get the performance recommendations on your screen)

http://ondataperf.com/ (provides ORACLE database performance analysis using your STATSPACK or AWR METRICS that is generated from your database. All that is required are simple text files that are uploaded to the OnDataperf performance analysis engine.)

http://community.dbapool.com/dbanalyzer.php

Also: Don't forget that although some queries may be costly they might not be run frequently, so you also need to consider frequency of use.

{edit, added the following}
and: regarding the AWR you might find this helpful:
How to get the most relevant information from a Statspack or AWR report in just one hour. Focusing only on the details that can be tuned, and that can potentially improve the user response time.
http://prezi.com/glqm9zemzhup/interpreting-awr-report-straight-to-the-goal/
0
 
LVL 15

Assisted Solution

by:Franck Pachot
Franck Pachot earned 200 total points
Comment Utility
Hi,

Another tool very nice that I discovered recently: http://orachrome.com/index.html (has a free trial).

@PortletPaul, very good links - especially the last one ;)

Regards,
Franck.
0
 
LVL 48

Expert Comment

by:PortletPaul
Comment Utility
@FranckPachot - indeed it is, and I thank you for it ;)
0
 
LVL 1

Author Comment

by:marrowyung
Comment Utility
let me check
0
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.

 
LVL 1

Author Comment

by:marrowyung
Comment Utility
"http://orachrome.com/downloading.html"

it seem this one can't run on Windows server? what if I install it from a server and connect to the oracle ?

can I install on the Oracle server itself ?
0
 
LVL 48

Expert Comment

by:PortletPaul
Comment Utility
Is this a different question?
how does this relate to: "The Oracle top ten slowest query"
please open new questions for new topics
(and, close off finished questions)

Oracle (the dbms) is available for a range of Windows O/S platforms.
0
 
LVL 1

Author Comment

by:marrowyung
Comment Utility
I see this

"I discovered recently: http://orachrome.com/index.html (has a free trial). " here and I just ask in the same post.
0
 
LVL 48

Expert Comment

by:PortletPaul
Comment Utility
>>and I just ask in the same post.
which is not how it should be done in my opinion :(

THIS question is about "The Oracle top ten slowest query"

is this question answered? (if so it should be closed)

Sorry, but if the topic changes - so should the the question.
Taken to the extreme there would be only one question that meanders indefinitely.
0
 
LVL 15

Expert Comment

by:Franck Pachot
Comment Utility
>> it seem this one can't run on Windows server? what if I install it from a server and connect to the oracle ?
>> can I install on the Oracle server itself ?
It's just a java standalone application, you can intall it everywhere.
0
 
LVL 1

Author Comment

by:marrowyung
Comment Utility
franckpachot,

"It's just a java standalone application, you can intall it everywhere. "

nice.
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.

Join & Write a Comment

Suggested Solutions

Subquery in Oracle: Sub queries are one of advance queries in oracle. Types of advance queries: •      Sub Queries •      Hierarchical Queries •      Set Operators Sub queries are know as the query called from another query or another subquery. It can …
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 …
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now