Top 20 Sql

ljm0211發表於2012-06-20
top 20 效率最差的sql
   SELECT *
   from (
   SELECT EXECUTIONS ,ROUND((BUFFER_GETS-DISK_READS)/BUFFER_GETS,2) Hit_radio,
   ROUND(DISK_READS/EXECUTIONS,2) Reads_per_run,
   SQL_TEXT
   FROM V$SQLAREA
   WHERE EXECUTIONS>0
   AND BUFFER_GETS > 0
   AND (BUFFER_GETS-DISK_READS)/BUFFER_GETS < 0.8 ) a
   where rownum<21 ;
執行時間最長的top 20 sql
SELECT *
from (
SELECT sql_text sql, executions runtimes, buffer_gets/decode(executions, 0, 1, executions) / 4000 responsetime
FROM v$sql
WHERE buffer_gets / decode(executions, 0,1, executions) / 4000 > 10
AND executions > 0
order by 2 desc) a
where rownum <21

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/11411056/viewspace-733388/,如需轉載,請註明出處,否則將追究法律責任。

相關文章