[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Analyze Table in Oracle

Posted on 2009-04-14
6
Medium Priority
?
944 Views
Last Modified: 2012-05-06
Hi,
   When i analyze the table with below command, the table is getting analyzed. I want to know the corresponding index also got analyzed or not?

 DBMS_STATS.gather_table_stats ('XXQP', 'XXQP_SAMPLE', estimate_percent => 30);

Thanks
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 74

Expert Comment

by:sdstuber
ID: 24138206
by default NO, indexes are not gathered with table stats.

However, in 10g and above the default is configurable
you can check the default with this in 10g and above

BEGIN
    IF DBMS_STATS.to_cascade_type(DBMS_STATS.get_param('CASCADE'))
    THEN
        DBMS_OUTPUT.put_line('indexes gathered with table stats');
    ELSE
        DBMS_OUTPUT.put_line('indexes NOT gathered with table stats');
    END IF;
END;
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 24138224
In 8i and 9i the default is always FALSE for "cascade"
0
 

Author Comment

by:Suriyaraj_Sudalaiappan
ID: 24138875
Hi,
  I have oracle 10g and i am running the your code. It is returning 'indexes NOT gathered with table stats'.
How?

Thanks
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 74

Accepted Solution

by:
sdstuber earned 500 total points
ID: 24138909
"How?"  what are you asking?


The output means your default has not been modified.
So indexes are not gathered when you gather table stats unless you override that default.

set cascade  TRUE if you want to gather indexes when you gather tables

DBMS_STATS.gather_table_stats ('XXQP', 'XXQP_SAMPLE', estimate_percent => 30, cascade=>TRUE);

0
 

Author Closing Comment

by:Suriyaraj_Sudalaiappan
ID: 31569865
GOOD ONE
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 24146860
glad I could help
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

649 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