DBAsupport.com Forums - Powered by vBulletin
Results 1 to 6 of 6

Thread: To find objects belonging to a tablespace

  1. #1
    Join Date
    Sep 2001
    Posts
    112

    Question

    I have just noted that today, one of the datafiles that was yesterday, 484 Meg full - is today 250 Meg full.

    Each datafile relates directly to a tablespace for simplicity so.

    Can someone help me discover every object that exists in a tablespace please, tables - indexes and anything else.

    I assume I need a query of some sort.

  2. #2
    Join Date
    Sep 2001
    Posts
    112
    Hey I had a thought.

    Yesterday, I rebuilt all indexes, coalesced all tablespaces, analyzed everything. Also coalesced the indexes after the rebuild.

    This could possibly have affected my DB. .

    Do you think its possible I retrieved like 200 Meg from a 500 Meg file.

  3. #3
    Join Date
    Sep 2001
    Location
    Makati, Philippines
    Posts
    857
    If you were only to identify what object type
    in a certain tablespace then:
    select distinct segment_type
    from dba_segments
    where tablespace_name='TABLESPACE_NAME';

    The consumed size of your tablespace becomes lower
    because you issues commands to optimize your objects
    resulting your tablespace to consume less size where in
    your object resides.


  4. #4
    Join Date
    Feb 2001
    Location
    Paris, France
    Posts
    809
    you can do :

    select segment_name, segment_type
    from dba_segments
    where tablespace_name = '...';

    and :

    select object_name, object_type
    from dba_objects
    where sysdate-created <2;

    first one will give you all the segments in the tablespace you enter, and second one will give you the objects that were created less than 2 days ago, that way you can find out what filled your tablespace.

  5. #5
    Join Date
    Sep 2001
    Posts
    112
    Lovely Jublee

    Thx

  6. #6
    Join Date
    May 2015
    Location
    Earth
    Posts
    1
    DBA_SEGMENTS does not show all objects, like LOB Indexes.

    Use this quote:

    select 'SEGMENTS' tipo, owner, segment_name, TABLESPACE_NAME from dba_segments where TABLESPACE_NAME <> 'TSD_DBAMLAT' and owner in ('CAP_WATTS','DBAMLAT')
    union
    select 'TABLES' tipo, owner, table_name, TABLESPACE_NAME from dba_tables where tablespace_name <> 'TSD_DBAMLAT' and owner in ('CAP_WATTS','DBAMLAT')
    union
    select 'INDEXES' tipo, owner, index_name, TABLESPACE_NAME from dba_indexes where tablespace_name <> 'TSD_DBAMLAT' and owner in ('CAP_WATTS','DBAMLAT')

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width