码迷,mamicode.com
首页 > 数据库 > 详细

oracle 查询 LOB 字段大小

时间:2018-06-06 21:38:36      阅读:193      评论:0      收藏:0      [点我收藏+]

标签:partition   pen   分区表   order by   account   ble   open   查询   join   

select distinct ab.TABLE_NAME,
                ab.SEGMENT_NAME,
                ab.TABLESPACE_NAME,
                ab.OWNER,
                sum(ac.BYTES / 1024 / 1024 / 1024) GB
  from dba_lobs ab, DBA_SEGMENTS ac
 where ab.OWNER IN (SELECT USERNAME
                      FROM DBA_USERS A
                     WHERE A.account_status = ‘OPEN‘
                       AND A.default_tablespace NOT IN
                           (‘SYSTEM‘,
                            ‘USERS‘,
                            ‘SYSAUX‘,))
   and ab.SEGMENT_NAME = ac.segment_name
   and ab.OWNER = ac.owner
--and ab.TABLESPACE_NAME = ‘LOB_DATA‘
 group by ab.TABLE_NAME, ab.SEGMENT_NAME, ab.TABLESPACE_NAME, ab.OWNER
 order by 5 desc

---针对单表(分区表)查询 单个分区LOB 字段大小

SELECT DLP.TABLE_NAME,
       DLP.COLUMN_NAME,
       DLP. PARTITION_NAME,
       DS.BYTES / 1024 / 1024 / 1024 GB
  FROM DBA_LOB_PARTITIONS DLP
  LEFT JOIN DBA_SEGMENTS DS
    ON (DLP.LOB_PARTITION_NAME = DS.PARTITION_NAME)
 WHERE DLP.TABLE_NAME = ‘T_TEST
   AND DS.SEGMENT_NAME = ‘SYS_LOB0000318949C00003$$‘;

 

oracle 查询 LOB 字段大小

标签:partition   pen   分区表   order by   account   ble   open   查询   join   

原文地址:https://www.cnblogs.com/ss-33/p/9146730.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!