Locating Similar SQL in Oracle
Locating Similar SQL in Oracle
Oracle bind variables are a super important way to make Oracle SQL reentrant.
The activities needed to parse a statement and generate an execution plan are CPU intensive and
generate recursive SQL against the data dictionary which may result in physical IO as well. The
added statement and parse tree takes up space in the shared pool. I have seen several databases
where the shared pool was over a gigabyte in size (one were it was 4 gig!) until bind variables were
introduced, reducing the size to a couple of hundred megabytes at most.
A quick method of seeing whether code is being reused (a key indicator of proper bind variable
usage) is to look at the values of reusable and non-reusable memory in the shared pool. A SQL for
determining this comparison of reusable to non-reusable code is shown in figure 1.
www.oracle-script.com