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: Oracle10g, Need to find number of rows in each table in a schema

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

From: Mark D Powell <Mark.Powell_at_eds.com>
Date: 3 Nov 2006 12:03:33 -0800
Message-ID: <1162584213.228101.315260@e3g2000cwe.googlegroups.com>

On Nov 3, 2:00 pm, "Michel Cadot" <micadot{at}altern{dot}org> wrote:
> "janu" <ang..._at_gmail.com> a écrit dans le message de news: 1162579697.634588.94..._at_f16g2000cwb.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 -- Received on Fri Nov 03 2006 - 14:03:33 CST

Original text of this message

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