dbTalk Databases Forums  

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

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss Oracle10g, Need to find number of rows in each table in a schema in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
janu
 
Posts: n/a

Default Oracle10g, Need to find number of rows in each table in a schema - 11-03-2006 , 12:48 PM






Hi Gurus,

I am looking for a stored procedure or package to find total number of
rows in each table in a schema.

Something like, you can pass the schema name ot the SP or may be simple
query.

Thank you
RA


Reply With Quote
  #2  
Old   
Michel Cadot
 
Posts: n/a

Default Re: Oracle10g, Need to find number of rows in each table in a schema - 11-03-2006 , 01:00 PM







"janu" <angani (AT) gmail (DOT) com> a écrit dans le message de news: 1162579697.634588.94410 (AT) f16g200...oglegroups.com...
Quote:
Hi Gurus,

I am looking for a stored procedure or package to find total number of
rows in each table in a schema.

Something like, you can pass the schema name ot the SP or may be simple
query.

Thank you
RA

Set heading off
Set feedback off
Set pagesize 0
Set termout off
Set trimout on
Set trimspool on
Set recsep off
Set linesize 100
Column d noprint new_value date_
Spool tmp
Select 'Select '''||table_name||' : ''||count(*) from '||owner||'.'||table_name||';',
to_char(sysdate, 'YYYYMMDDHH24MISS') d
from dba_tables where owner=upper('&1')
order by table_name
/
Spool off
Spool count_&1._&date_
@tmp.LST
Spool off

Regards
Michel Cadot




Reply With Quote
  #3  
Old   
Mark D Powell
 
Posts: n/a

Default Re: Oracle10g, Need to find number of rows in each table in a schema - 11-03-2006 , 02:03 PM





On Nov 3, 2:00 pm, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
Quote:
"janu" <ang... (AT) gmail (DOT) com> a écrit dans le message de news: 1162579697.634588.94... (AT) f16g2000cwb (DOT) googlegroups.com...
| Hi Gurus,
|
| I am looking for a stored procedure or package to find total number of
| rows in each table in a schema.
|
| Something like, you can pass the schema name ot the SP or may be simple
| query.
|
| Thank you
| RA
|

Set heading off
Set feedback off
Set pagesize 0
Set termout off
Set trimout on
Set trimspool on
Set recsep off
Set linesize 100
Column d noprint new_value date_
Spool tmp
Select 'Select '''||table_name||' : ''||count(*) from '||owner||'.'||table_name||';',
to_char(sysdate, 'YYYYMMDDHH24MISS') d
from dba_tables where owner=upper('&1')
order by table_name
/
Spool off
Spool count_&1._&date_
@tmp.LST
Spool off

Regards
Michel Cadot
Here is another example using pl/sql

Is there a simple way to produce a report of all tables in the database
with current number of rows ?
http://www.jlcomp.demon.co.uk/faq/count_all_rows.html

HTH -- Mark D Powell --



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.