Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to? - Count number of rows in all tables

Re: How to? - Count number of rows in all tables

From: Chris Hamilton <toneczar_at_erols.com>
Date: Tue, 26 May 1998 16:31:52 GMT
Message-ID: <6keqqj$c53$4@goo.nwd.usace.army.mil>


syd_at_compuserve.comz (Paul Smith) wrote:

>I would like to count the number of rows in each of the tables owned by a
>certain user :
> ...
>It seems I need to be able to perform something like the following...
>
>select tname TableName, count(*) RowCount
>from ?!!? where ?!!? in (select tname from tab);

>I feel the need for dynamic SQL - am I right ? - I've never used it before.

An easy way would be to run the ANALYZE command on all of the objects in the database (excluding SYS), and query the NUM_ROWS column of thge DBA_TABLES view. Not necessarily 100% accurate, but quick and easy.

Chris



Chris Hamilton, DBA
US Army Corps of Engineers
christopher.h.hamilton_at_usace.army.mil
http://www.serve.com/cowpb/chamilton.html Received on Tue May 26 1998 - 11:31:52 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US