dbms_stats with estimate_percent=>dbms_stats.auto_sample_size

Posted on 2006-06-02
Medium Priority
Last Modified: 2008-01-09
Hello Experts:

Everytime I try to use this value for estimate_percent I get this error:

ERROR at line 1:
ORA-06550: line 1, column 102:
PLS-00302: component 'AUTO_SAMPLE_SIZE' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

What I am I doing wrong?  Do I need to initialize this variable?  How?  Why would I need to do it if Oracle is going to do it itself?


Question by:simonk_klammer
LVL 19

Expert Comment

ID: 16819554

    you might need to add somthing like:

    AUTO_SAMPLE_SIZE number;

    in your declaration area.
LVL 12

Expert Comment

ID: 16819765
You can always specify out the percentage such as in this one:

DBMS_STATS.gather_schema_stats (
      ownname            => 'HT4'
     ,estimate_percent   => 40
     ,block_sample       => FALSE
     ,method_opt         => 'FOR ALL INDEXED COLUMNS'
     ,degree             => NULL
     ,granularity        => 'DEFAULT'
     ,options            => 'GATHER'
     ,cascade            => TRUE
LVL 19

Expert Comment

ID: 16819894
>>dbms_stats with estimate_percent=>dbms_stats.auto_sample_size
     my mistake. ignore my answer :)
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 32

Accepted Solution

awking00 earned 500 total points
ID: 16834158
What version of Oracle? This feature was not made available until 9i.

Author Comment

ID: 17330110
To awking00:

My version is 8i.  Your response may explain why it doesn't seem to work.
LVL 32

Expert Comment

ID: 17333204
Sorry :-(

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article started out as an Experts-Exchange question, which then grew into a quick tip to go along with an IOUG presentation for the Collaborate confernce and then later grew again into a full blown article with expanded functionality and legacy…
Cursors in Oracle: A cursor is used to process individual rows returned by database system for a query. In oracle every SQL statement executed by the oracle server has a private area. This area contains information about the SQL statement and the…
This video explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
Suggested Courses
Course of the Month16 days, 20 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question