Oracle11g 查看表空间使用率

2021/11/16 19:13:29

本文主要是介绍Oracle11g 查看表空间使用率,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

查询11g表空间使用率:

set  linesize 200  pagesize 999

col  tablespace_name for a30

col file_name  for  a65

select  name inst_name, b.tablespace_name ,

ROUND(b.total/1024/1024/1024 ,4) total_GB ,

ROUND(b.maxtotal/1024/1024/1024,4) maxtotal_GB,

ROUND(a.free/1024/1024/1024,4) free_GB,

ROUND((b.total-a.free)/1024/1024/1024 ,4) used_GB,

ROUND((b.total-a.free)/b.maxtotal,5)*100 Used_Pct

from  

( select  tablespace_name,SUM(bytes) free from  DBA_FREE_SPACE group by  tablespace_name  ) a,

(select  tablespace_name,SUM(bytes) total,sum( case maxbytes when 0 then  bytes  else maxbytes end)  maxtotal

from   dba_data_files group by  tablespace_name ) b , v$database

where b.tablespace_name=a.tablespace_name

and b.tablespace_name not like '%UNDO%'

order by  Used_Pct desc ;

查询表空间是否自动扩展:

select  file_name ,autoextensible ,increment_by  from  dba_data_files ;



这篇关于Oracle11g 查看表空间使用率的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程