Sujosh,
Yes, you can gather statistics for each table, in each schema, in your database. You can gather statistics by table, by schema, or for the entire database. As I mentioned to you in a thread yesterday, the syntax for gathering statistics one table at a time is:
Code:
analyze table <table_name> compute statistics;
To gather statistics for all tables in a schema, you can say:
Code:
exec dbms_utility.ANALYZE_SCHEMA(<schema_name>,'COMPUTE');
To gather statistics for all tables in all schemas on an Oracle 9i database, you can say:
Code:
exec dbms_stats.gather_database_stats(cascade=>true);
All of the above presume you are at the SQL*PLUS (SQL>) prompt.
You can also gather statistics by "sampling" a percentage of the rows in the tables. Anything over a 50 percent sampling does a full table scan, same as COMPUTE.
Once you have gathered statistics, you can issue commands such as:
Code:
SELECT table_name, avg_row_len, num_rows from USER_TABLES;
Let us know is this is what you wanted.
![[santa] [santa] [santa]](/data/assets/smilies/santa.gif)
Mufasa
(aka Dave of Sandy, Utah, USA @ 18:27 (21Jul04) UTC (aka "GMT" and "Zulu"), 11:27 (21Jul04) Mountain Time)