包括clob segment 大欄位 表的大小統計

zhenggaona1發表於2018-03-16
SELECT OWNER,TABLE_NAME,SUM(daxiao) from (
SELECT owner,SEGMENT_NAME as table_name,SUM(BYTES)/1024/1024/1024 as daxiao FROM DBA_SEGMENTS WHERE (OWNER,SEGMENT_NAME) IN (
SELECT OWNER,TABLE_NAME FROM DBA_TABLES WHERE OWNER NOT IN ('SYS','SYSTEM'))
GROUP BY SEGMENT_NAME,owner
union ALL
select lob.owner,lob.table_name,sum(seg.bytes)/1024/1024/1024 as daxiao from dba_lobs lob,dba_segments seg 
where lob.segment_name=seg.segment_name and lob.OWNER NOT IN ('SYS','SYSTEM') group by lob.owner,lob.table_name

GROUP BY OWNER,TABLE_NAME ORDER  BY 3 DESC;

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23944170/viewspace-2151923/,如需轉載,請註明出處,否則將追究法律責任。

相關文章