[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference eps::oracle

Title:Oracle
Notice:For product status see topics: UNIX 1008, OpenVMS 1009, NT 1010
Moderator:EPS::VANDENHEUVEL
Created:Fri Aug 10 1990
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1574
Total number of notes:4428

1548.0. "script to analyze tables and indexes (RDBMS)" by TROOA::HANDY (L. Handy, MCSE DTN 626-3210) Tue Apr 22 1997 20:34

    We are trying to run a blanket 'analyze table' or 'analyze index' on
    an Oracle v7.3.2.2 database for Peoplesoft GL (2000 tables).
    
    It would be very helpful to us and our customers if we could accomplish
    this with minimal effort and execution time.  Here is an example of
    what we attempted-  SYNTAX assistance required here :-)
    
    SVRMGR> select "analyze table " table_name from all_tables where
         2> table_name like 'PS%' " compute statistics" ;
    table_name like 'PS%' " compute statistics" 
                          *
    ORA-00933: SQL command not properly ended
    
    Thanks,
    
    Lyndon Handy
    Americas Benchmark Program
    Digital Equipment
T.RTitleUserPersonal
Name
DateLines
1548.1give this a tryALFAM7::GOSEJACOBWed Apr 23 1997 08:2722
    re .0
    > SYNTAX assistance required here :-)
    
    Alright here you go:
    
    set heading off
    set feedback off
    spool analyze.sql
    
    select 'analyze table ' || RTRIM(table_name) || ' compute statistics;'
    from all_tables
    where table_name like 'PS%';
    
    spool off
    
    @analyze
    
    This should do what you are looking for. Good luck with your benchmark.
    Cheers from the European DBTC
    
    	Martin
                                                                
1548.2Thanks- looks goodTROOA::HANDYL. Handy, MCSE DTN 626-3210Wed Apr 23 1997 15:564
    Wonderful!  Thanks, and I will keep this in our Exchange public folder
    for all to share.
    
    Lyndon