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 Statistics

792290Mar 14 2012 — edited Mar 14 2012
i need collect the statistics for few tables from a schema. i am doing the following:

i am creating a table to save the statistics.

begin
dbms_stats.create_stat_table(ownname =>'TEST',
statab =>'TEST_ORD',);
end;

and then i am gathering the table stats for a particular table as follows:

exec dbms_stats.gather_table_stats(
ownname => 'BNS',
estimate_percent =>'10,
statown =>'TEST',
tabname =>'ORDERS',
stattab =>'TEST_ORD',
statid =>'CR');

my question is how can do for multiple tables ? the reason is i have to create a Job to run this script automatically daily.

can i put this into a procedure? or any other ideas?

Appreciate all your help!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 11 2012
Added on Mar 14 2012
9 comments
830 views