从网上借用的sql语句,稍做修改,验证可行。
select
df.tablespace_name "TABLESPACE_NAME",totalspace "TOTALSPACE/M",freespace "FREESPACE/M",round((1-freespace/totalspace)*100,2) "USED%"
from
(select tablespace_name,round(sum(bytes)/1024/1024) totalspace from dba_data_files group by tablespace_name) df,
(select tablespace_name,round(sum(bytes)/1024/1024) freespace from dba_free_space group by tablespace_name) fs
where df.tablespace_name=fs.tablespace_name;
附上结果:
TABLESPACE_NAME TOTALSPACE/M FREESPACE/M USED%
------------------------------ ------------ - ---------- ----------
UNDOTBS1 25 21 16
SYSAUX 240 3 98.75
USERS 5 2 60
SYSTEM 480 4 99.17
EXAMPLE 100 32 68
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9617129/viewspace-614984/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/9617129/viewspace-614984/