count of all tables in a schema [message #268992] |
Thu, 20 September 2007 06:51  |
srilaxmi
Messages: 16 Registered: June 2007 Location: hyderabad
|
Junior Member |
|
|
hi all!
how to get the table names and record count(no.of rows) of each table in a schema
thanks & regards
srilaxmi
|
|
|
|
|
Re: count of all tables in a schema [message #269000 is a reply to message #268995] |
Thu, 20 September 2007 07:07   |
srilaxmi
Messages: 16 Registered: June 2007 Location: hyderabad
|
Junior Member |
|
|
hi!
in the scott user, i have given a query like this
sql>select table_name,num_rows from user_tables;
then it is dispalying like this
NUM_ROWS TABLE_NAME
--------- ------------------------------
BONUS
EMP
3 LOOKUP
................and so on
it is displaying num_rows for only 1 table
why it is not displaying count for all the tables?
please reply me
thanks & regards
srilaxmi
|
|
|
Re: count of all tables in a schema [message #269003 is a reply to message #269000] |
Thu, 20 September 2007 07:26  |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
Quote: | num_rows is the number of rows that were in the table last time its statistics were gathered
|
If you've never gathered statistics for your tables then this column will be unpopulated.
You need to read up on DBMS_STATS, and particularly the GATHER_TABLE_STATS and GATHER_SCHEMA_STATS subprograms
|
|
|