1、统计单个表所占空间
select segment_name,round(sum(BYTES)/1024/1024/1024,2) GB from user_segments
where partition_name like 'DWB_PSUSCPN%'
group by segment_name
使用dba_segments或user_segments都可以
2、查看oracle空间
SELECT a.tablespace_name 表空间名,
round(a.bytes/1024/1024/1024,2) 总空间,
round(b.bytes/1024/1024/1024,2) 使用空间,
round(c.bytes/1024/1024/1024,2) 空闲空间,
d.maxbytes 最大空间,
round((b.bytes * 100) / a.bytes,2) "% USED ",
round((c.bytes * 100) / a.bytes,2) "% FREE "
FROM sys.sm$ts_avail a, sys.sm$ts_used b, sys.sm$ts_free c,
(SELECT tablespace_name,round(SUM(maxbytes) / 1024 / 1024 / 1024, 2) maxbytes FROM dba_data_files GROUP BY tablespace_name) d
WHERE a.tablespace_name = b.tablespace_name
AND a.tablespace_name = c.tablespace_name
AND a.tablespace_name = d.tablespace_name;
标签:语句,1024,name,bytes,空间,tablespace,oracle,round,统计表 From: https://www.cnblogs.com/ZJ199012/p/16662537.html