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

Home -> Community -> Usenet -> c.d.o.tools -> Re: count for a newbie

Re: count for a newbie

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Tue, 19 Sep 2000 16:57:09 +0800
Message-ID: <39C72A65.376C@yahoo.com>

Bryant Baecht wrote:
>
> Here is an updated sql statement and the output:
>
> select segment_name,count(*) from sys.dba_segments where owner='F_SW' group
> by segment_name
>
> SEGMENT_NAME
> ------------------------------------------------------------------------------
> -
> COUNT(*)
> ----------
> DA_ARCHIVEDATE
> 1
>
> DA_DELETEDATE
> 1
>
> DA_DOCNUMBER
> 1
>
> DC_DOCCLASSNAME
> 1
>
> DC_DOCCLASSNUMBER
> 1
>
> DI_DOCCLASSNUMBER
> 1
>
> DOCTABA
> page^Cq
>
> 1
>
> 8 rows selected.
>
> Instead of the count always being equal to one ( because each table has only 1
> entry in sys.dba_segments ), I want it to equal the number of entries in each
> respective table. Hopefully this is more descriptive. TIA
>
> Bryant
>
> In article <8q5ivs$stt$1_at_nnrp1.deja.com>, sanrenkur_at_my-deja.com wrote:
> >Hi
> >Try WHERE OWNER='TOM'
> >Hth
> >Sanrenkur
> >
> >
> >Sent via Deja.com http://www.deja.com/
> >Before you buy.

select table_name, num_Rows
from dba_tables

will give you a rough estimate (assuming you are doing regular analyze commands)

otherwise use an sql you build an sql...

spool blah.sql
select 'select count(*) from '||owner||'.'||table_name||';' from dba_tables
spool off

@blah.sql

-- 
===========================================
Connor McDonald
http://www.oracledba.co.uk

We are born naked, wet and hungry...then things get worse
Received on Tue Sep 19 2000 - 03:57:09 CDT

Original text of this message

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