Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: dba script
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.
Received on Fri Dec 17 1999 - 09:26:24 CST
![]() |
![]() |