Call (800) 766-1884 for Oracle support & training
Free Oracle Tips


Oracle Consulting Support
Oracle Upgrades
Use New Oracle Features
Oracle Replication Support
Oracle Training
Remote Oracle DBA
System Documentation
Oracle Tips
Oracle Performance
 

Free Oracle Tips


 

HTML Text

BC Oracle tuning

Oracle training

Oracle support

Remote Oracle

 

 

   
  Oracle Tips by Burleson


 

UPDATE_BY_CAT

 

The update_by_cat procedure changes all of the outlines in one category to a new category. If the SQL text in an outline already has an outline in the target category, then it is not merged into the new category. The procedure has two input variables, oldcat VARCHAR2 and newcat VARCHAR2 where oldcat corresponds to the category to be merged and newcat is the new category that oldcat is to be merged with.

 

SQL> create outline test_outline for category test on

  2  select a.table_name, b.tablespace_name, c.file_name from

  3  dba_tables a, dba_tablespaces b, dba_data_files c

  4  where

  5  a.tablespace_name=b.tablespace_name

  6  and b.tablespace_name=c.tablespace_name

  7  and c.file_id = (select min(d.file_id) from dba_data_files d

  8  where c.tablespace_name=d.tablespace_name)

  9  ;

 

Operation 180 succeeded.

 

SQL> create outline test_outline2 for category test on

  2  select * from dba_data_files;

 

Operation 180 succeeded.

 

SQL> create outline prod_outline1 for category prod on

  2  select owner,table_name from dba_tables;

 

Operation 180 succeeded.

 

SQL> create outline prod_outline2 for category prod on

  2  select * from dba_data_files;

 

Operation 180 succeeded.

 

SQL>  select name,category from dba_outlines order by category

NAME           CATEGORY

--------------- --------

PROD_OUTLINE1   PROD

PROD_OUTLINE2   PROD

TEST_OUTLINE2   TEST

TEST_OUTLINE    TEST

 

4 rows selected.

 

SQL> execute sys.outln_pkg.update_by_cat('TEST','PROD');

 

PL/SQL procedure successfully completed.

 

SQL> select name,category from dba_outlines order by category;

NAME           CATEGORY

--------------- --------

TEST_OUTLINE    PROD

PROD_OUTLINE1   PROD

PROD_OUTLINE2   PROD

TEST_OUTLINE2   TEST

 

4 rows selected.

 

As a result of the update_by_cat procedure call we moved the TEST_OUTLINE outline into the PROD category, but the TEST_OUTLINE2, since it is a duplicate of  PROD_OUTLINE2, was not merged.


The above text is an excerpt from:

Using Oracle SQL Stored Outlines & Optimizer Plan Stability
ISBN 0-9740716-8-4

by Mike Ault
 

http://www.rampant-books.com/ebook_plan_stability.htm


Download your Oracle scripts now:

www.oracle-script.com

The definitive Oracle Script collection for every Oracle professional DBA

  
 

Oracle performance tuning software 
 
 
 
 

Oracle performance tuning book

 

 
 
 
Oracle performance Tuning 10g reference poster
 
 
 
Oracle training in Linux commands
 
Oracle training Excel
 
Oracle training & performance tuning books
 

 

   

Copyright © 1996 -  2014 by Burleson. All rights reserved.

Oracle® is the registered trademark of Oracle Corporation.