查找bad sql的方法
查找運行系統裡bad sql是一個古老的話題
絕不能教條的運用下面介紹的這些方法
使用這些SQL語句時
建議大家在系統啟動了一段時間後
下面是我收藏的一些查找bad sql的方法:
column sql_text format a
select
substr(to_char(s
s
p
from
(
select
address
disk_reads
executions
pct
rank() over (order by disk_reads desc) ranking
from
(
select
address
disk_reads
executions
from
sys
where
command_type !=
)
where
disk_reads >
) s
sys
where
s
p
order by
/
select * from (select buffer_gets
from v$sqlarea
where buffer_gets >
order by buffer_gets desc) where rownum<=
select sql_text
(select sql_text
where rownum<
select sql_text
(select sql_text
where rownum<
select sql_text
(select sql_text
where rownum<
set pagesize
set linesize
select substr(sql_text
from v$sqlarea
where executions <
group by substr(sql_text
having count(*) >
order by
set pages
select sum(a
from v$sesstat a
where a
and b
group by b
select count(
select user_name
group by user_name
select sql_text from v$sqltext_with_newlines where (hash_value
(select sql_hash_value
order by address
From:http://tw.wingwit.com/Article/program/Oracle/201311/17220.html