Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

Oracle bind variable peeking tips

Oracle Database Tips by Donald BurlesonOctober 14,  2015


Bind variable peeking is used with SQL statements in the library cache to see if the value of a host variable is going to change the existing execution plan.  The overhead of bind variable peeking was significant, and it was enable by setting this paraneter:

alter system set cursor_sharing=similar scope=both;

These issues with bind variable peeking led to the 11g adaptive cursor sharing feature.

In order to make efficient use of the Oracle shared pool (library cache), SQL statements must be re-entrant, and a good way to do this is to replace literal values with bind variables:

select * from customer where name = 'Burleson";

select * from customer where name = ':var1";

You can use the cursor_sharing=force init.ora parameter to replace literals in SQL with bind variable; a Godsend for making SQ: re-entrant and relieving stress on the shared pool SGA region.  See my notes here:

Unfortunately, there is a downside to this because the "invisible" bind variable gives less information to the Oracle optimizer.  This is especially important then the bind variable value is skewed (e.g. has popular and unpopular values) because the optimizer might choose an inefficient index or an unnecessary full-scan.

Up until 11g 11g adaptive cursor sharing, the implementation of bind variable peeking could cause performance problems, and many shops would disable bind variable peeking by opening a SR on MOSC and getting permission to set _optim_peek_user_binds=false.

Note:  For testing purposes, you may want to turn-off optimizer bind variable peeking and this can be done in several ways::

  • Re-set the _optim_peek_user_binds=false hidden parameter.

  • Disable new histogram creation by re-analyze using dbms_stats with the argument:  method_opt=> 'for all columns size 1';


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.