Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: [Q] how to find how many row in each table in database?
Larry Leung wrote:
>
> Ari Kaplan wrote:
>
> >
> > What you should do is make a SQL script that creates another SQL script containing all tables.
> > Try the following:
> >
> > SET HEAD OFF
> > SET PAGESIZE 0
> > SET FEEDBACK OFF
> > SPOOL SCRIPT.SQL
> > SELECT 'select count(*) from '||OWNER||'.'||TABLE_NAME||';'
> > FROM ALL_TABLES
> > SPOOL OFF
>
> thanks for the solution. this is the kind of automated solution i
> wanted.
> but i just wonder is that possible not to really read thru every row
> of every table in order to find this out.
> like does oracle maintain a row count for each table in some system
> table.
>
> larry
>
> llarry_at_hkstar.com
analyze the tables and then see the column 'num_rows' in all_tables/dba_tables table.
amit
Oracle DBA/Unix SA Received on Wed Jul 30 1997 - 00:00:00 CDT