ITPub博客

首页 > 数据库 > Oracle > Oracle 11g tablespace usage

Oracle 11g tablespace usage

原创 Oracle 作者:tolilong 时间:2015-08-10 13:42:12 0 删除 编辑
在pl sql developer的preferences-->files-->directories-->command files添加文件sp.sp的内容如下:
set pagesize 100
set timing on
select x.tablespace_name,y.bytes/1024/1024 total_size_mb,x.bytes/1024/1024 free_size_mb,(y.bytes-x.bytes)/1024/1024 use_size_mb,round((y.bytes-x.bytes)/y.bytes,4)*100 usage
from
(select tablespace_name,sum(bytes) bytes from dba_free_space group by tablespace_name) x,
(select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) y
where x.tablespace_name=y.tablespace_name
order by  5 desc;
然后就可以执行@sp文件中的内容.

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

上一篇: 获取Oracle DBID
请登录后发表评论 登录
全部评论

注册时间:2010-07-13

  • 博文量
    406
  • 访问量
    1208671