Re: SQL EXPERTS ONLY
From: Naren Chintala <naren_at_mink.att.com>
Date: 1996/07/30
Message-ID: <4tlt1b$n6p_at_newsb.netnews.att.com>#1/1
Date: 1996/07/30
Message-ID: <4tlt1b$n6p_at_newsb.netnews.att.com>#1/1
mgreen1962_at_aol.com (MGreen1962) wrote:
>I need to produce a report that shows how many records are in each table.
>i.e:
>
>Table_Name Number Recs
>----------------------------------------------------------------------
>Employees 413
>Customer 5257
>...
>
>How can I do this? Is there a datadictionary table that contains the
>number records in a table? Thanks to all that attempt to answer this
>question.
>
>Send suggestions to MGREEN1962_at_aol.com
Do the following (analyzing large tables could be painful)
- Run the dbmsutil.sql when logged in as SYS if it has NOT been done.
- Login as the user id where the tables belong (ex. SCOTT)
- execute dbms_utility.analyze_schema('SCOTT','COMPUTE'); This will populate the user_tables.
- select table_name,num_rows from user_tables;
(ex.)
TBLE_NAME NUM_ROWS
Employees 413 Customer 5257 - execute dbms_utility.analyze_schema('SCOTT','DELETE'); This will delete the statistics in the user_tables.
Hope this helps.
Naren Chintala
naren_at_mink.att.com
Received on Tue Jul 30 1996 - 00:00:00 CEST