You were brought to this page based on an internet search
and as a free service to Oracle DBAs.
The text below is an except from the book,
Oracle Performance Firefighting, written by
Craig Shallahamer of
OraPub, Inc.
Figures and tables are not included on this page, only their reference.
To order the book in either print or PDF form, click
here.
©2009, 2010 by Craig Shallahamer. This is copyrighted material.
PleaseOut of respect for those involved in the creation of the book and also for
their familes, we ask you to respect the copyright both in intent and deed. Thank you.
-------------------------------
Another way to quickly implement bind variable usage is to have Oracle automatically transform the SQL. Oracle will effectively take non-bind variable SQL and transform it into bind variable SQL.2 Suppose you notice a SQL statement like the one shown here.
If you know your application SQL well, you may be aware that this exact SQL does not actually exist anywhere in the application. In fact, if you checked the SQL the application submits to Oracle, it may look like this:
What you are seeing is the result of Oracle automatically transforming SQL so it becomes more shareable. Oracle calls this feature cursor sharing. The related instance parameter, cursor_sharing, can take three options and can be altered at both the session and system level. With a value of exact, no transformation occurs. With a value of similar, Oracle looks for bind variables and transform them in, what I call, a kinder and gentler fashion. When set to force, Oracle transforms any and every literal value into a bind variable.
©2009, 2010 by Craig Shallahamer. This is copyrighted material.
PleaseOut of respect for those involved in the creation of the book and also for
their familes, we ask you to respect the copyright both in intent and deed. Thank you.
|