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

Home -> Community -> Mailing Lists -> Oracle-L -> Re: [Q] How to check what kind of objects on tablespace and datafile???

Re: [Q] How to check what kind of objects on tablespace and datafile???

From: stephen booth <stephenbooth.uk_at_gmail.com>
Date: Tue, 17 May 2005 17:18:14 +0100
Message-ID: <687bf9c40505170918280de8d1@mail.gmail.com>


On 5/17/05, dba1 mcc <mccdba1_at_yahoo.com> wrote:
> I check ORACLE view "dba_tablespace", "dba_data_files"
> and "dba_objects". I can not find any object
> information. Does there has way to check what kind of
> Oracle objects (like tables, index, ..) in tablespace
> and datafiles?

select tablespace_name,
segment_type,
count(segment_name)
from dba_segments
group by tablespace_name, segment_type;

That will give you a list of each tablespace with segments in and how many of each. If you're interested in just one particular tablespace then use a where clause.

As one segment can have extents in multiple datafiles within the same tablespace it's possibly not that useful to look for what segments are in what datafile. If you really wanted/needed to know then I figure you'd have to use dba_extents instead of dba_segments, lose the count() and the group by but join to dba_data_files on file_id to get the filename.

Stephen

--=20
It's better to ask a silly question than to make a silly assumption.

--
http://www.freelists.org/webpage/oracle-l
Received on Tue May 17 2005 - 12:23:28 CDT

Original text of this message

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