Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to? - Count number of rows in all tables
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