Reader small image

You're reading from  Oracle Database 11gR2 Performance Tuning Cookbook

Product typeBook
Published inJan 2012
Reading LevelIntermediate
PublisherPackt
ISBN-139781849682602
Edition1st Edition
Languages
Right arrow
Author (1)
Ciro Fiorillo
Ciro Fiorillo
author image
Ciro Fiorillo

Ciro Fiorillo is an IT professional and consultant with experience of more than a decade in different roles (developer, analyst, DBA, project manager, data and software architect) among software industries. He has worked on different technologies and architectures, such as Oracle, SQL Server, Delphi, C# and .NET Framework, C/C++, Java, PHP, COBOL, Fortran, and Tibco. Ciro is currently employed as Lead Software and Data Architect with FinWin Srl, a software house specializing in banking and loans applications. As a freelancer he writes articles for websites and printed magazines about software and computing, participates in workshops, and teaches C++ and Fortran parallel programming with Intel Software tools. Ciro can be reached at ciro@cirofiorillo.com.
Read more about Ciro Fiorillo

Right arrow

Introducing Adaptive Cursor Sharing for bind variable peeking


In the previous chapter, we have explored the (recommended) use of bind variables.

In this recipe, we will see how using bind variables can be disadvantageous in certain situations and learn about a feature of Oracle Database 11g that helps us with this.

How to do it...

The following steps will demonstrate Adaptive Cursor Sharing:

  1. Connect to SH schema:

    CONNECT sh@TESTDB/sh
    
  2. Create a table for testing with a field ID that equals 1:

    CREATE TABLE sh.MY_TEST AS SELECT
      OBJECT_NAME AS NAME, 1 AS ID
    FROM ALL_OBJECTS NOLOGGING;
    
  3. Insert eight records with different values for the ID field:

    INSERT INTO sh.MY_TEST (ID, NAME)
      VALUES (2, 'ONLY THIS RECORD HAS ID=2');
    INSERT INTO sh.MY_TEST (ID, NAME)
      VALUES (3, 'ONLY THIS RECORD HAS ID=3');
    INSERT INTO sh.MY_TEST (ID, NAME)
      VALUES (4, 'ONLY THIS RECORD HAS ID=4');
    INSERT INTO sh.MY_TEST (ID, NAME)
      VALUES (5, 'ONLY THIS RECORD HAS ID=5');
    INSERT INTO sh.MY_TEST (ID, NAME)
      VALUES (6, ...
lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Oracle Database 11gR2 Performance Tuning Cookbook
Published in: Jan 2012Publisher: PacktISBN-13: 9781849682602

Author (1)

author image
Ciro Fiorillo

Ciro Fiorillo is an IT professional and consultant with experience of more than a decade in different roles (developer, analyst, DBA, project manager, data and software architect) among software industries. He has worked on different technologies and architectures, such as Oracle, SQL Server, Delphi, C# and .NET Framework, C/C++, Java, PHP, COBOL, Fortran, and Tibco. Ciro is currently employed as Lead Software and Data Architect with FinWin Srl, a software house specializing in banking and loans applications. As a freelancer he writes articles for websites and printed magazines about software and computing, participates in workshops, and teaches C++ and Fortran parallel programming with Intel Software tools. Ciro can be reached at ciro@cirofiorillo.com.
Read more about Ciro Fiorillo