Thursday, May 19, 2011

SCRIPT TO FIND OUT THE TOP SQL STATEMENTS IN YOUR DATABASE

SCRIPT TO FIND OUT THE TOP SQL STATEMENTS IN YOUR DATABASE
----------------------------------------------------------------------------------------------------------

SELECT b.username username, a.disk_reads phyreads, a.executions noexec,
a.disk_reads
/ DECODE (a.executions, 0, 1, a.executions) rds_ex_ratio,
a.command_type, a.sql_text sqlqry
FROM v$sqlarea a, dba_users b
WHERE a.parsing_user_id = b.user_id AND a.disk_reads > 10000
ORDER BY a.disk_reads DESC;

No comments:

Post a Comment