Re: [Q] How to list all the tables in DB??

From: R. Schierbeek <bytelife_at_worldaccess.nl>
Date: 1996/04/30
Message-ID: <bytelife-3004961522490001_at_ldn5-1.worldaccess.nl>#1/1


In article <4m3c3q$j8a_at_news2.cais.com>, duffy_at_cais.cais.com (MCC) wrote:
> We have Oacle 7.2.3 installed on SUN Solaris 2.5. Can anyone tell me how
> to list all the tables in DB? the list should include table name,
> tablespace name, owner info. Thank you for help.

sqlplus system/passwd
col TABLESPACE_NAME format A20
col OWNER format A20
select owner,table_name,tablespace_name
from DBA_TABLES
order by owner,table_name ;

OR, if you want an overview of other objects (e.g. indexes):

col TABLESPACE_NAME format A20
col OWNER format A20
col SEGMENT_TYPE format A10 head TYPE
col KBytes for 999,999
select TABLESPACE_NAME,OWNER SEGMENT_TYPE "TYPE"

       ,count(SEGMENT_NAME) "OBJECT#" 
       ,trunc(sum(bytes/1024),0) "KBytes"
from DBA_SEGMENTS
group by TABLESPACE_NAME ,OWNER, SEGMENT_TYPE ;

Good luck,
R. Schierbeek, DBA
email: bytelife_at_worldaccess.nl Received on Tue Apr 30 1996 - 00:00:00 CEST

Original text of this message