oracle AWR 报告中按已用时间排序的 SQL
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/24136907/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
SQL ordered by Elapsed Time in AWR report
提问by being_uncertain
I was trying to analyze the AWR
report generated for a particular process with a duration of one hour. I am trying to find out which query is taking much time
to while running the process.
我试图分析AWR
为持续时间为一小时的特定过程生成的报告。我试图找出运行该过程时哪个查询花费了大量时间。
When I have gone through the report, I can see SQL ordered by Gets
,SQL ordered by CPU Time
,SQL ordered by Executions
,SQL ordered by Parse Calls
,
SQL ordered by Sharable Memory
,SQL ordered by Elapsed Time
etc.
当我翻阅报告了,我可以看到SQL ordered by Gets
,SQL ordered by CPU Time
,SQL ordered by Executions
,SQL ordered by Parse Calls
,
SQL ordered by Sharable Memory
,SQL ordered by Elapsed Time
等。
I can see the SQL Text
from the table SQL ordered by Elapsed Time
.
我可以SQL Text
从表中看到SQL ordered by Elapsed Time
。
My question: Is this the right way to identify the expensive query ? Please advise in this regard.
我的问题:这是识别昂贵查询的正确方法吗?请就此提出建议。
Elapsed Time (s) SQL Text
19,477.05 select abc.....
7,644.04 select def...
回答by being_uncertain
SQL Ordered by Elapsed Time
, includes SQL statements that took significant execution time during processing.We have to look at Executions
,Elapsed time per Exec (s)
etc. along with Elapsed time
to analyze.
SQL Ordered by Elapsed Time
, 包括在处理过程中花费大量执行时间的 SQL 语句。我们必须查看Executions
,Elapsed time per Exec (s)
等等 并Elapsed time
进行分析。
For example,a query has low Executions
and high Elapsed time per Exec (s)
and this query could be a candidate for troubleshooting or optimizations.
例如,查询具有低Executions
和高,Elapsed time per Exec (s)
并且该查询可能是故障排除或优化的候选。
The best reference I found so far: http://www.dbas-oracle.com/2013/05/10-steps-to-analyze-awr-report-in-oracle.html
迄今为止我找到的最佳参考:http: //www.dbas-oracle.com/2013/05/10-steps-to-analyze-awr-report-in-oracle.html
回答by eliatou
AWR is used to see database health. So, I think this is not the good tools to trace a process.
AWR 用于查看数据库健康状况。所以,我认为这不是跟踪进程的好工具。
You should use other tools like sql_trace (with tkprof) or dbms_profiler. It will concenrate on your own process. If you are using sql_trace, you need to connect to the server (or ask to the dba tem) to analyse the trace.
您应该使用其他工具,例如 sql_trace(使用 tkprof)或 dbms_profiler。它将专注于您自己的过程。如果您使用 sql_trace,则需要连接到服务器(或询问 dba tem)以分析跟踪。
回答by Seth Projnabrata
In SQL Ordered by Elapsed time you always need to check the Query which is having low Execution numbers and higher Elapsed time . This would always be the problematic Query . Since Elapsed time is the defined task for a respective Query in this case if it is higher with less number of Executions it means that for some reason the Query is performing not up to expectations .
在 SQL Ordered by Elapsed time 中,您总是需要检查具有低执行次数和更高 Elapsed time 的 Query 。这将始终是有问题的 Query 。由于已用时间是在这种情况下为相应 Query 定义的任务,如果它在执行次数较少的情况下更高,则意味着由于某种原因,查询的执行不符合预期。