当前位置:Gxlcms > 数据库问题 > oracle 数据库查询表空间

oracle 数据库查询表空间

时间:2021-07-01 10:21:17 帮助过:21人阅读

set linesize 200
col file_name for a50
select c.TABLESPACE_NAME,c.SEGMENT_SPACE_MANAGEMENT,d.sum_MB,d.free_MB,d.use_precent,c.EXTENT_MANAGEMENT from dba_tablespaces c,
(select b.tablespace_name,round(sum(b.bytes)/1024/1024,0) sum_MB, round(sum(nvl(a.bytes,0))/1024/1024,0) free_MB,
round((sum(b.bytes)-sum(nvl(a.bytes,0)))/sum(b.bytes),4)*100 use_precent
from (select tablespace_name,file_id,sum(bytes) bytes from dba_free_space group by tablespace_name,file_id ) a,
dba_data_files b
where a.file_id(+)=b.file_id and a.tablespace_name(+)=b.tablespace_name
group by b.tablespace_name
order by use_precent) d
where c.TABLESPACE_NAME=d.TABLESPACE_NAME
order by 5 desc;

oracle 数据库查询表空间

标签:gem   数据库查询   size   nes   free   data   lin   files   dba   

人气教程排行