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


DROP_BY_CAT
 

The drop_by_cat procedure drops all outlines that belong to a specific category. The procedure drop_by_cat has one input variable, cat, a VARCHAR 2 that corresponds to the name of the category you want to drop.

 

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> select * from dba_outlines where category='TEST';

NAME         OWNER  CATEGORY USED   TIMESTAMP VERSION    SQL_TEXT                        

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

TEST_OUTLINE SYSTEM TEST     UNUSED 08-MAY-99 8.1.3.0.0  select a.table_name, b.ta       

                                                         blespace_name, c.file_nam       

                                                         e from                     

                                                         dba_tables a, dba_tablesp       

                                                         aces b, dba_data_files c        

                                                         where                           

                                                         a.tablespace_name=b.table       

                                                         space_name                      

                                                         and b.tablespace_name=c.t       

                                                         ablespace_name                  

                                                         and c.file_id = (select m       

                                                         in(d.file_id) from dba_da       

                                                         ta_files d                      

                                                         where c.tablespace_name=d       

                                                         .tablespace_name)               

                                                                                         

                                                                                          

 

1 row selected.

 

SQL> execute sys.outln_pkg.drop_by_cat('TEST');

 

PL/SQL procedure successfully completed.

 

SQL> select * from dba_outlines where category='TEST';

 

no rows selected
 


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.