Put your tips and tricks online - Share your knowledge! Login | Register
 
 
  Search     Advanced search
 

Home | Ask Question | Add tip | My tips | Recent tips & tricks | Suggest a category | FAQ | Forums

 
 
 
 Category : Home > Databases > Oracle > Performance Tuning     

Script to analyze table subpartitions


This script will analyze specified subpartitions in a loop, useful when some partitions /
subpartitions in the table have been modified or re-built.

BEGIN
  FOR rec IN
    (SELECT subpartition_name
     FROM all_tab_subpartitions
     WHERE table_owner = 'SCHEMA_OWNER'
     AND table_name = 'TABLE_NAME'
         AND partition_name in ('SUBPART1', 'SUBPART2', 'SUBPART3'))
   LOOP
     SYS.DBMS_STATS.GATHER_TABLE_STATS(
             OwnName          => 'SCHEMA_OWNER',
             TabName          => 'TABLE_NAME',
             PartName         => rec.subpartition_name,
             Granularity      => 'SUBPARTITION',
             Estimate_Percent => 10,
             Degree           => NULL,
             Cascade          => TRUE);
   END LOOP;
END;
/


  Options
 
   del.icio.us  |  newsvine  |  digg  |  furl  |  google  |  yahoo  |  Ma.gnolia  |  vigillar  |  reddit  |  technorati  |  icerocket  |  pubsub

       Rate this tip:    

Start discussion or add comment to this tip

  Details
Tip reference : #176
views : 777
Added on : 06/27/07
Submited by : h8dk97
 
Send a message Send a message Printer friendly output Printer friendly output
Display this member's tips Display this member's tips (149)
 
 
<< Previous Next >>
 Most viewed tips 
  Databases > Oracle > Security : How to unlock Oracle user account  
  Databases > Oracle > Performance Tuning : How to enable trace in Oracle  
  Databases > Oracle : Kill user session  
  Databases > Oracle : Scripts to backup Oracle database on Windows NT  
   
  All categories
Databases | Programming | Hardware | Operating Systems | Networking | Internet | ERP / CRM | Games & Multimedia | Graphics & Design | Miscellaneous | Office Software | TipLib FAQ
 
 

Home |  FAQ |  Terms of Use |  Privacy Policy

© 2005 tiplib.com