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!

Gather table and table partition stats

Mike301Oct 8 2014 — edited Oct 8 2014

Friends...

OS: Linux

DB: 11gR2

I'm moving some tables and table partitions to new tablespaces and would like to gather stats after each table or partition gets moved with their index.

So basically loop will be

1. Move table/partition

2. Move indexes for table/partition #1

3. Gather stats for table/partition

I'm using below syntax for gather partition table and partition index stats,

but for 15GB of partition data it took 10 hours to gather stats,

does below syntax does something more than just gatheri

*** Table partition gather stats

exec dbms_stats.gather_table_stats(ownname=>'own1', tabname=>'part_tab', partname=>'part_tab_10_01', estimate_percent=>10, cascade=>true);

I somehow believe it's due to cascade parameter it took so long, is above syntax correct or somebody guide me to proper way to gather stats for individual table or table partition along with indexes?

Couldn't get/find much detail from manual so decided to take expert help from here.

Thanks and much appreciated.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 5 2014
Added on Oct 8 2014
3 comments
1,177 views