oracle 查询 LOB 字段大小
Posted 钱若离花落
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oracle 查询 LOB 字段大小相关的知识,希望对你有一定的参考价值。
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 字段大小的主要内容,如果未能解决你的问题,请参考以下文章