查看ORACLE表空间大小及所剩空间大小
来源:互联网 发布:安全数据交换系统 编辑:程序博客网 时间:2024/05/10 15:14
select f.tablespace_name,
a.total,
u.used,
f.free,
round((u.used / a.total) * 100) "% USED",
round((f.free / a.total) * 100) "% FREE"
from (select tablespace_name, sum(bytes / (1024 * 1024)) total
from dba_data_files
group by tablespace_name) a,
(select tablespace_name, round(sum(bytes / (1024 * 1024))) used
from dba_extents
group by tablespace_name) u,
(select tablespace_name, round(sum(bytes / (1024 * 1024))) free
from dba_free_space
group by tablespace_name) f
where a.tablespace_name = f.tablespace_name
and a.tablespace_name = u.tablespace_name;
下面这种方法更快:
select a.tablespace_name,
a.bytes / 1024 / 1024 "Sum MB",
(a.bytes - b.bytes) / 1024 / 1024 "used MB",
b.bytes / 1024 / 1024 "free MB",
round(((a.bytes - b.bytes) / a.bytes) * 100, 2) "percent_used"
from (select tablespace_name, sum(bytes) bytes
from dba_data_files
group by tablespace_name) a,
(select tablespace_name, sum(bytes) bytes, max(bytes) largest
from dba_free_space
group by tablespace_name) b
where a.tablespace_name = b.tablespace_name
order by ((a.bytes - b.bytes) / a.bytes) desc;
- 查看ORACLE表空间大小及所剩空间大小
- Oracle查看表空间大小及使用率
- 查看Oracle表空间及修改表空间大小。
- oracle表空间大小查看
- 查看oracle表空间大小
- 查看oracle表空间大小
- Oracle查看表空间大小
- 查看oracle表空间大小
- oracle 查看表空间大小
- oracle 查看表空间大小
- 查看Oracle表空间大小
- ORACLE查看表空间大小
- oracle 查看表所占用的空间大小
- oracle 查看表所占用空间的大小
- oracle 查看表所占用的空间大小
- Oracle查看表空间的大小及使用情况
- ORACLE查看表空间的名称及大小
- 查看表空间大小
- 本地化测试
- 软件实施工程师的工作
- 蓦然回首——我看过的书
- Sql2008数据库周期性自动备份
- 聪明说话35招
- 查看ORACLE表空间大小及所剩空间大小
- 【VS2005】调试与直接运行的区别(待调查)
- 数据库日常维护的脚本编绘语句
- JDK_API中关于String的几个方法的使用
- 关于ioremap
- 避免微软Vista浏览器崩溃的小技巧
- 关于php将浮点数转为整数的问题
- CString类的GetBuffer,ReleaseBuffer 函数
- 对象指针