DBAsupport.com Forums - Powered by vBulletin
Results 1 to 7 of 7

Thread: Analyze_table Vs Analyze_Schema

  1. #1
    Join Date
    May 2001
    Posts
    13

    Unhappy

    Hi,

    I want to do a complete analyze of all tables and index in a schema. Do I use analyze_table on every table or do I use Analyze_schema (taht will analyze every tables and index under the shcema)?

    Which one is less consuming for the CPU and the system ?

    Thank for your help !
    Fugazi...

  2. #2
    Join Date
    Apr 2000
    Location
    Baltimore, MD
    Posts
    759
    Use analyze_schema.

  3. #3
    Join Date
    Mar 2001
    Posts
    635
    Hi

    Right use analyze_schema this is less time consuming for you in one command it will analyze all the objects in the schema where if you analyze using analyze_table you will have to do it manually one by one or write a script put all the analyze_table statements in it and then execute the file.I feel both of them will consume the same CPU resources

    Regards
    Santosh

  4. #4
    Join Date
    May 2001
    Posts
    13

    Smile

    Thank You very much !!! I really appreciate.

    Fugazi...

  5. #5
    Join Date
    Nov 2000
    Location
    Baltimore, MD USA
    Posts
    1,339
    However, analyze_schema is a serial process. If you write your own, you can launch several jobs simultanwously that can each analyze a different set of tables. This is, AFAIK, the most efficient way to analyze the entire schema.

    - Chris

  6. #6
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    with DBMS_STATS you can analyze the schema in parallel

  7. #7
    Join Date
    Jan 2001
    Posts
    318
    I read that analyze_schema can sometimes lock the whole system...is this true ? how do you avoid that ?

    I have these 2 scripts for analyze_schema..

    BEGIN

    sys.dbms_utility.analyze_schema ( '&OWNER','COMPUTE');

    END ;

    /
    BEGIN

    dbms_utility.analyze_schema ( '&OWNER', 'ESTIMATE', NULL, 5 ) ;

    END ;

    /

    Whats the difference between ESTIMATE and COMPUTE...
    We always do compute here. When will you do Estimate ?
    When do you do validate structure ?

    Also if you do analyze table it does analyze indexes too right, I saw the new date in user_indexes tables..just wanted to confirm this.

    If say I analyze all of my tables today i.e May 21st... and I do lots of DML on that database. For how long will they be using cost based optimizer ? In other words when do I need to analyze all my tables again ?


    thanks
    Sonali
    Sonali

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width