抓最费资源SQL的SQL
--执行时间最长的select rownum as rank, a.*
from (
select elapsed_Time,
executions,
buffer_gets,
disk_reads,
cpu_time
hash_value,
sql_text,
sql_fulltext
from v$sqlarea
where elapsed_time > 20000
order by elapsed_time desc) a
where rownum < =10
--sCPU TIME最大的
elect rownum as rank, a.*
from (
select elapsed_Time,
executions,
buffer_gets,
disk_reads,
cpu_time
hash_value,
sql_text,
sql_fulltext
from v$sqlarea
where cpu_time > 20000
order by cpu_time desc) a
where rownum < =10
--逻辑读最多的
select rownum as rank, a.*
from (
select buffer_gets,
executions,
buffer_gets/ decode(executions,0,1, executions) gets_per_exec,
hash_value,
sql_text,
sql_fulltext
from v$sqlarea
where buffer_gets > 50000
order by buffer_gets desc) a
where rownum < =10
--物理读最多的
select rownum as rank, a.*
from (
select disk_reads,
executions,
disk_reads / decode(executions,0,1, executions) reads_per_exec,
hash_value,
sql_text,
sql_fulltext
from v$sqlarea
where disk_reads > 10000
order by disk_reads desc) a
where rownum < =10
处理的数据量最大的
select rownum as rank, a.*
from (
select rows_processed,
executions,
rows_processed / decode(executions,0,1, executions) rows_per_exec,
hash_value,
sql_text,
sql_fulltext
from v$sqlarea
where rows_processed > 10000
order by rows_processed desc) a
where rownum < =10 标题写的有点像大后天(明天的明天的明天)。。 谢谢分享,以后可以直接复制粘贴用了。
不过书写检查还是要严谨点,譬如少了标点符号啊,中英文逗号 ",""," 问题啊 坤哥,做得不错。 好东东,多谢分享! 支持下,不错 支持下吧,虽然需要更改下。。 支持下,:lol:lol:lol:lol:lol:lol
页:
[1]