Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

can dbms_stats.gather_index_stats be used for all indexes of a schema?

Dan AOct 23 2008 — edited Oct 25 2008
Hi.
Today have to rebuild a bundle of indexes in a several different schemas. Then use the dbms_stats.gather_index_stats to generate the stats for them.
I would like to know if I can run this for all the indexes of a given schema, say INV, rather than this way:

exec dbms_stats.gather_index_stats
(ownname => 'INV', indname => 'MTL_SYSTEM_ITEMS_JHN99');

The point is, I only want to gather stats for a handful of schemas, but I want all the indexes of said schemas to be analysed.

I understand that this is possible to do for al the objects in one schema -
DBMS_STATS.GATHER_SCHEMA_STATS

But I wanted to get it for just the indexes.

And I gather that this DBMS_STATS.GATHER_INDEX_STATS can be done, and using NULL for the ownname, means we only collect for current schema)


Cheers.
9.2.0.1
AIX 5.2

Edited by: Dan A on Oct 23, 2008 11:19 AM

Edited by: Dan A on Oct 23, 2008 11:21 AM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 22 2008
Added on Oct 23 2008
7 comments
18,594 views