Sql代码 :
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) bwhere a.tablespace_name=b.tablespace_nameorder by ((a.bytes-b.bytes)/a.bytes) desc
“Sum MB”表示表空间所有的数据文件总共在操作系统占用磁盘空间的大小
比如:test表空间有2个数据文件,datafile1为300MB,datafile2为400MB,那么test表空间的“Sum MB”就是700MB
“userd MB”表示表空间已经使用了多少
“free MB”表示表空间剩余多少
“percent_user”表示已经使用的百分比
2、比如从1中查看到MLOG_NORM_SPACE表空间已使用百分比达到90%以上,可以查看该表空间总共有几个数
据文件,每个数据文件是否自动扩展,可以自动扩展的最大值。