> 文章列表 > --查看某个表及其组件所占的各个表空间的大小

--查看某个表及其组件所占的各个表空间的大小

--查看某个表及其组件所占的各个表空间的大小

--查看某个表及其组件所占的各个表空间的大小

select sum(bytes) as mb, tablespace_name
  from (select sum(bytes / 1024 / 1024) as bytes,
               s.tablespace_name as tablespace_name
          from dba_segments s, dba_indexes i
         where s.owner = i.owner
           and s.segment_name = i.index_name
           and s.owner = 'EAS86'
           AND i.TABLE_NAME = 'T_BAS_CODINGRULE'
         group by s.tablespace_name
        
        union
        
        select sum(bytes / 1024 / 1024), s.tablespace_name
          from dba_segments s, dba_tables t
         where s.owner = t.owner
           and s.segment_name = t.table_name
           and s.owner = 'EAS86'
           AND t.TABLE_NAME = 'T_BAS_CODINGRULE'
         group by s.tablespace_name
        
        union
        select sum(bytes / 1024 / 1024), s.tablespace_name
          from dba_segments s, dba_lobs l
         where s.owner = l.owner
           and s.segment_name = l.segment_name
           and s.owner = 'EAS86'
           AND l.TABLE_NAME = 'T_BAS_CODINGRULE'
         group by s.tablespace_name
        
        union
        select sum(bytes / 1024 / 1024), s.tablespace_name
          from dba_segments s, dba_tab_partitions p
         where s.owner = p.table_owner
           and s.segment_name = p.partition_name
           and s.owner = 'EAS86'
           AND p.TABLE_NAME = 'T_BAS_CODINGRULE'
         group by s.tablespace_name
        
        )
 group by tablespace_name