查找低效的sql语句

SELECT  EXECUTIONS , DISK_READS, BUFFER_GETS, 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 ORDER BY  4 DESC;


占CPU时间长的sql

SELECT ROWNUM top, t.*
FROM (SELECT x.CPU_TIME/x.executions per_cpu, x.hash_value, x.sql_text
FROM v$sqlarea x
WHERE x.executions>0
AND x.parsing_user_id <>0
ORDER BY x.CPU_TIME/x.executions DESC) t
WHERE ROWNUM < 21

你可能感兴趣的:(sql语句)