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

Thread: Analyze en oracle 9i

  1. #1
    Join Date
    Jan 2003
    Posts
    40

    Analyze en oracle 9i

    When I execute this sentence
    dbms_stats.gather_table_stats('zzz','table_name','partition_name')

    it takes more than 30 minutes, what can I do??

  2. #2
    Join Date
    Feb 2001
    Location
    Paris, France
    Posts
    809
    Is your partition huge ?

    You could try estimating the stats instead of computing them, for example on 20% of the rows :

    dbms_stats.gather_table_stats ('zzz', 'table_name', 'partition_name', 20);

  3. #3
    Join Date
    Jan 2003
    Posts
    40
    My partitions have between 200.000 ,300.000 rows.

  4. #4
    Join Date
    Jan 2003
    Posts
    40

    Talking

    I want also to know how much time takes to analyze (average) in analyze one partition with 300.000 rows using dbmstats??

  5. #5
    Join Date
    Feb 2001
    Location
    Paris, France
    Posts
    809
    it depends on a lot of things, but shouldn't be longer than a few minutes...

    did you try to estimate the stats instead of computing them ?

  6. #6
    Join Date
    Aug 2002
    Location
    Colorado Springs
    Posts
    5,253
    is parallelism enabled on the table?
    David Aldridge,
    "The Oracle Sponge"

    Senior Manager, Business Intelligence Development
    XM Satellite Radio
    Washington, DC

    Oracle ACE

  7. #7
    Join Date
    Jun 2001
    Location
    Helsinki. Finland
    Posts
    3,938
    Originally posted by slimdave
    is parallelism enabled on the table?
    Here is what I use in PROD for analyzing the schemas, it works well:

    PROCEDURE anal_schema(P_SCHEMA in varchar2)
    is
    W_SCHEMA varchar2(30);
    BEGIN
    W_SCHEMA := P_SCHEMA;
    DBMS_STATS.GATHER_SCHEMA_STATS(ownname => W_SCHEMA,
    estimate_percent => DBMS_STATS.AUTO_SAMPLE_SIZE,
    degree => DBMS_STATS.DEFAULT_DEGREE,
    options => 'GATHER STALE',
    method_opt => 'for all columns size AUTO',
    cascade => TRUE);
    END;

    Just run first:

    exec DBMS_STATS.ALTER_SCHEMA_TAB_MONITORING('SCOTT',true);

    to turn monitoring on for the SCOTT's schema (for example) in case you wanna gather STALE statistics.

    Do you know what is stale statistics?
    Oracle Certified Master
    Oracle Certified Professional 6i,8i,9i,10g,11g,12c
    email: ocp_9i@yahoo.com

  8. #8
    Join Date
    Jan 2003
    Posts
    40
    And if I use this sentence??
    dbms_stats.gather_table_stats('OWN_SIMEL',reg_CurParti.table_name,reg_CurParti.partition_name,
    NULL,
    FALSE,'FOR ALL COLUMNS SIZE 1',NULL,'PARTITION');

    It's good??

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