查询”帐户/库”数据占用存储空间大小
select sum(bytes)/1024/1024 as “size(M)” from dba_segments where owner=’帐户名/库名’
查询单表数据占用存储空间大小
select sum(bytes)/(1024*1024) as “size(M)” from user_segments
where segment_name=upper(‘表名’);
在表空间中,查询占用存储空间最大的表
SELECT * FROM (SELECT SEGMENT_NAME, SUM(BYTES) / 1024 / 1024 MB FROM
DBA_SEGMENTS WHERE TABLESPACE_NAME = upper(‘SYSAUX’) GROUP BY SEGMENT_NAME
ORDER BY 2 DESC) WHERE ROWNUM < 10;
在”帐户/库”中,查询占用存储空间最大的表
SELECT * FROM (SELECT SEGMENT_NAME, SUM(BYTES) / 1024 / 1024 MB FROM
DBA_SEGMENTS WHERE owner=upper(‘帐户名/库名’) GROUP BY SEGMENT_NAME ORDER BY 2 DESC)
WHERE ROWNUM < 10;
热门工具 换一换