Re: Oracle10g, Need to find number of rows in each table in a schema

From: G Quesnel <dbaguy_ott_at_yahoo.com>
Date: 6 Nov 2006 10:12:50 -0800
Message-ID: <1162836770.881907.49210_at_f16g2000cwb.googlegroups.com>


You can use SQL writting SQL, something like... spool myscript.sql
Select 'Select count(*) on '||table_name ...

and then run that script.
And you can clean it up so it prompts for the schema and displays the table name in front of the row count.
But what the previous posters indicated is correct. Why go through all this effort to find out the emp table is currently at 100,002 while the stats that were generated 8 hours ago show 99,994. Keep in mind that if you run the same query in 5 minutes you could get 100,004 rows.

As the other people suggested, in most cases using the tables statistics is what makes most sense.
Feel free to explain your business case, and people will be able to offer advice or warning with your approach.

hth Received on Mon Nov 06 2006 - 19:12:50 CET

Original text of this message