Skip to Content
Oracle Database 11gR2 Performance Tuning Cookbook
book

Oracle Database 11gR2 Performance Tuning Cookbook

by Ciro Fiorillo
January 2012
Intermediate to advanced
542 pages
11h 28m
English
Packt Publishing
Content preview from Oracle Database 11gR2 Performance Tuning Cookbook

Creating SQL Tuning Sets

In this recipe, we will see how we can store a group of SQL statements along with their execution context and statistics, obtaining a so-called SQL Tuning Set.

Getting ready

To create a SQL Tuning Set, we need the ADMINISTER SQL TUNING SET privilege, so we grant this privilege to SH user, which will be used in this recipe.

CONNECT / AS SYSDBA
GRANT ADMINISTER SQL TUNING SET TO sh;

How to do it...

The following steps will demonstrate how to create and use SQL Tuning Sets:

  1. Connect to SH schema:
    CONNECT sh@TESTDB/sh
    
  2. Execute some queries to populate the cursor cache:
    SELECT CUST_FIRST_NAME, CUST_LAST_NAME, CUST_CITY
    FROM CUSTOMERS
    ORDER BY CUST_CITY;
    
    SELECT * FROM (
      SELECT
        CUST_ID, CUST_FIRST_NAME,
     CUST_LAST_NAME, CUST_YEAR_OF_BIRTH ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Oracle Database 11g Performance Tuning Recipes: A Problem-Solution Approach

Oracle Database 11g Performance Tuning Recipes: A Problem-Solution Approach

Sam R. Alapati, Darl Kuhn, Bill Padfield

Publisher Resources

ISBN: 9781849682602Other