the 'best' way to find bad SQL is to look in your cache for SQL that has done LOTS of Disk I/O or SQL that has done LOTS of SGA reads. (the first needs indexes, the sacond needs better indexes)
select hash value,
disk_reads,
Buffer_gets,
sorts,
Executions,
loads,
from v$sqlarea
Where disk_read > 50,000
order by disk_reads
you change the where and order by to suit the 'badness' you are looking for, how you have a list of hash values who are 'bad'.
now to find each statement
select hash_value,
Piece,
Sql_text
from v$sqltext
where hash_value = &number
order by 1,2
The one thing you can't give for your heart's desire is your heart. - Lois McMaster Bujold
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.