Gather table Statistics
792290Mar 14 2012 — edited Mar 14 2012i 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!