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

Home -> Community -> Usenet -> c.d.o.server -> Re: dba script

Re: dba script

From: Erik Cotsonas <cotsonas_at_my-deja.com>
Date: Mon, 20 Dec 1999 19:09:14 GMT
Message-ID: <83lusn$b96$1@nnrp1.deja.com>


Not true for this situation. I am only using dba_tables to get a list of table names. The query generates select count(*) from <table>. I am not querying the statistical count in this situation, but literally executing a select count for every table. You are correct however, if I were getting the num_rows by way of statistics, I would need to make sure that the analyze was executed before the count query.

Erik

In article <83dkmq$rmf$1_at_nnrp1.deja.com>,   Bernard Polarski <bpolarsk_at_yahoo.com> wrote:
> Be carefull with DBA_TABLES. This will give expected results only if
> you analyse every table before querying its fields. The DBA_TABLES
> keeps records of the last time you analyzed a table. In order to know
> when your table has been last analysed, you must consult
> DBA_TAB_COLUMNS.LAST_ANALYSED
>
> I wrote something for that two years ago, so you may have look
> to "http://www.geocities.com/bpolarsk/screenshots.html" (point 4).
This
> is an 'ali baba cave' for all these small things. You will probably
> find what your are looking for.
>
> Regards
>
> B. Polarski
> www.geocities.com
>
> In article <83b3cu$44q$1_at_nnrp1.deja.com>,
> Erik Cotsonas <cotsonas_at_my-deja.com> wrote:
> > Save the following as a script and execute it through sqlplus. In
the
> > where clause specify the schemas for which you want to count tables
> >
> > [snip]
> > set pagesize 0
> > set linesize 1000
> > set trimspool on
> >
> > SPOOL tblCounts.tmp
> >
> > select 'SELECT RPAD(''' || owner || '.' || table_name || ': '', 50)
||
> > COUNT(*) FROM ' || owner || '.' || table_name || ';'
> > from dba_tables
> > where owner in ('SCHEMA1', 'SCHEMA2')
> > order by owner, table_name;
> >
> > SPOOL off
> >
> > @tblCounts.tmp
> >
> > [snip]
> >
> > Erik
> >
> > In article <106d149e.911676ac_at_usw-ex0107-049.remarq.com>,
> > narayan <narayan_raykarNOnaSPAM_at_engineer.com.invalid> wrote:
> > > hi guys..
> > > can u help me with a script that will
> > > give me the
> > > no of records in each table of each user within a database.
> > >
> > > i have 6 users and 151 tables for each user.
> > > help me out on this
> > > narayan
> > >
> > > * Sent from RemarQ http://www.remarq.com The Internet's Discussion
> > Network *
> > > The fastest and easiest way to search and participate in Usenet -
> > Free!
> > >
> > >
> >
> > --
> > Erik
> > Consultant
> > Saraswati Systems Corporation - (SSC)
> >
> > Sent via Deja.com http://www.deja.com/
> > Before you buy.
> >
>
> --
> B.Polarski
>
> http://www.geocities.com/bpolarsk
> Email : bpolarsk_at_yahoo.com
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

--
Erik
Consultant
Navigant Consulting, Inc. - (NCI)

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Mon Dec 20 1999 - 13:09:14 CST

Original text of this message

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