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:15:43 GMT
Message-ID: <83lv8r$bfg$1@nnrp1.deja.com>


Yes, you could join this to all_users. Keep in mind that SYS, SYSTEM, etc... are users and the query would then generate queries for all of the tables owned by them which is alot (you probably don't want to do that). You could select from all_users and then specifially filter out SYS, SYSTEM, etc... if you want.

Also, my original query counts views as well (since I didn't filter them out). So if you don't want views to be included you would need to join to all_objects or dba_objects and select only the objects that are of type TABLE.

NOTE: all_tables and dba_tables contain both tables and views.

Erik

In article <05d70c71.12dae9f6_at_usw-ex0107-049.remarq.com>,   narayan <narayan_raykarNOnaSPAM_at_engineer.com.invalid> wrote:
> In article <83b3al$44a$1_at_nnrp1.deja.com>, Erik Cotsonas
> <cotsonas_at_my-deja.com> wrote:
> > Save the following as a script and execute it through sqlplus
> > [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 ('NTEX', 'ECOTSONAS')
> > order by owner, table_name;
> > SPOOL off
> > @tblCounts.tmp
> > [snip]
>
> hi Erik,
> thanks 4 replyin..
> can the above script b more automised by takin the owners from
> ALL_USERS
> bye..
>
> * 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
Navigant Consulting, Inc. - (NCI)

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

Original text of this message

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