Solved

Analyze Table in Oracle

Posted on 2009-04-14
6
939 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
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 74

Accepted Solution

by:
sdstuber earned 125 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
Via a live example, show how to take different types of Oracle backups using RMAN.

726 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