查询”帐户/库”数据占用存储空间大小

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;

友情链接
KaDraw流程图
API参考文档
OK工具箱
云服务器优惠
阿里云优惠券
腾讯云优惠券
华为云优惠券
站点信息
问题反馈
邮箱:[email protected]
QQ群:637538335
关注微信