ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 查看表空间的空间使用情况

查看表空间的空间使用情况

原创 Linux操作系统 作者:oracle_ace 时间:2007-12-25 15:59:14 0 删除 编辑

两个脚本特记录如下,有点意思:
tablespace status
********************
select
b.file_id file_id,
b.tablespace_name,
b.bytes,
b.maxbytes,
(b.bytes-sum(nvl(a.bytes,0))) used,
sum(nvl(a.bytes,0)) unused,
sum(nvl(a.bytes,0))/(b.bytes)*100 percentage
from dba_free_space a,dba_data_files b
where a.file_id=b.file_id
group by b.tablespace_name,b.file_id,b.bytes,b.maxbytes
order by b.file_id;

or

select tablespace_name,sum(bytes)/1024/1024/1024 GB
from dba_data_files group by tablespace_name
union all
select tablespace_name,sum(bytes)/1024/1024/1024 GB
from dba_temp_files group by tablespace_name order by GB;

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12361284/viewspace-1318/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 启用autotrace功能
请登录后发表评论 登录
全部评论

注册时间:2007-12-10

  • 博文量
    284
  • 访问量
    843198