Find SQL with excessive hard parses

Find SQL with excessive hard parses ?


Question:  How do I find SQL statements with excessive hard parses?  I have a SQL statement and I want to know the hard parse and soft parse rate.
Answer:  Oracle does not have a dictionary view to directly measure the number of hard parses and soft parses, but you can see the number of soft parses in the v$sql view by looking at the "executions" column.
To find SQL with excessive hard parses you need to look for SQL statements that have only executed once, so you can see all non-reentrant SQL in your library cache as follows:

select count(*) from v$sql where executions=1;

=======================================================

Comments