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!

Running stats on multiple tables

839981Feb 15 2011 — edited Feb 15 2011
Hi,

I'm trying to run statistics on a custom list of tables and later on would create a job to run this nightly.

I'm having an issue with the syntax. I can run statistics on one table, but when I try an add in multiple tables it fails. I know it's failing on the tabname section when adding in the 2nd table and so forth. Do I have to separate each table stats into its own unique statement for each table or can I lump it all into 1 exec gather_table_stats statement?

exec dbms_stats.gather_table_stats(ownname=>'SYSADM',tabname=>'table1', 'table2',estimate_percent=> 100,method_opt=>'FOR ALL COLUMNS SIZE AUTO',cascade=>TRUE)

Any help would be greatly appreciated. Thanks in advance!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 15 2011
Added on Feb 15 2011
9 comments
12,016 views