To
rebuild all statistics to all the tables and indexes and building up all histograms, you should do
the following:
SQL>
EXECUTE dbms_stats.gather_schema_stats(
ownname => 'Username',
method_opt => 'FOR ALL INDEXED COLUMNS SIZE AUTO',
cascade=>TRUE);
But if you want to let Oracle decide which statistices are to be rebuild, you should the following
statment:
SQL>
EXECUTE dbms_stats.gather_schema_stats(
ownname => 'Username',
options => 'GATHER AUTO', -- for Oracle8i use GATHER only
cascade=>TRUE);
Good
Luck!