首页 > 开发 > 综合 > 正文

讲解如何检查使用空间大于90%的表空间

2024-07-21 02:42:22
字体:
来源:转载
供稿:网友
检查使用空间大于90%的表空间示例:

select a.tablespace_name,       totalspace,       nvl(freespace, 0) freespace,       (totalspace - nvl(freespace, 0)) used,       ((totalspace - nvl(freespace, 0)) / totalspace) * 100 "%USED"  from (select tablespace_name, sum(bytes) / 1048576 totalspace          from dba_data_files         group by tablespace_name) a,       (select tablespace_name, sum(Bytes) / 1048576 freespace          from dba_free_space         group by tablespace_name) b where a.tablespace_name = b.tablespace_name(+)   and ((totalspace - nvl(freespace, 0)) / totalspace) * 100 > 90--and nvl(freespace,0) < 1000  -- only list TSs < 1GB free order by 5 desc;

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表