Sunday, January 24, 2010

Get SQL with most disk read

SELECT t1.USERNAME,
DISK_READS,
EXECUTIONS,
ROUND(DISK_READS / DECODE(EXECUTIONS, 0, 1, EXECUTIONS)) "Reads/Execs",
SQL_TEXT
FROM dba_users t1, v$session, v$sqlarea
WHERE PARSING_USER_ID = USER_ID
AND ADDRESS = SQL_ADDRESS(+)
AND DISK_READS > 10000
ORDER BY DISK_READS DESC, EXECUTIONS DESC

No comments:

Post a Comment