oracle查看表空间使用率语句

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/gyqinag/article/details/86478257

ORACLE查看表空间使用率语句


SELECT a.tablespace_name “表空间名”,
total “表空间大小”,
free “表空间剩余大小”,
(total - free) “表空间使用大小”,
total / (1024 * 1024 ) “表空间大小(M)”,
free / (1024 * 1024 ) “表空间剩余大小(M)”,
(total - free) / (1024 * 1024 ) “表空间使用大小(M)”,
round((total - free) / total, 4) * 100 “使用率 %”
FROM
(SELECT tablespace_name, SUM(bytes) free FROM dba_free_space GROUP BY tablespace_name) a ,
(SELECT tablespace_name, SUM(bytes) total FROM dba_data_files GROUP BY tablespace_name) b
WHERE a.tablespace_name = b.tablespace_name;

查看用户表空间使用情况:
SELECT bytes/1024/1024 ||‘M’ TABLE_SIZE ,u.* FROM dba_SEGMENTS U WHERE U.owner IN (‘PROC’) ORDER BY 1 DESC;

猜你喜欢

转载自blog.csdn.net/gyqinag/article/details/86478257