QUOTE (ashishprem @ Feb 7 2006, 07:48 AM)
Please tell me what's the use of this stored procedure. As the name sounds it is for gathering the statistics of the table.If so please give me the code to use this. Are there any other advantages of that procedure.
I used this procedure and yes, this procedure is for gathering statistics of the table. I give you a code to use this with one or more tables. You have to use the results of this code:
select 'exec dbms_stats.gather_table_stats(' || CHR(39)|| owner || CHR(39) || ',' || CHR(39) ||table_name || CHR(39) || ',' || 'cascade => TRUE' || ')' || ';'
where tablespace_name like 'USERS' -- you can use wherever you want in the where clause
order by owner, table_name;
You'll obtain something like that:
exec dbms_stats.gather_table_stats('owner','table1',cascade => TRUE);
exec dbms_stats.gather_table_stats('owner','table2',cascade => TRUE);
exec dbms_stats.gather_table_stats('owner','table3',cascade => TRUE);
I hope that I help you.