300字范文,内容丰富有趣,生活中的好帮手!
300字范文 > 查询oracle表空间有什么数据 oracle查询表空间使用情况与查询有哪些数据库实例在运行...

查询oracle表空间有什么数据 oracle查询表空间使用情况与查询有哪些数据库实例在运行...

时间:2020-01-06 16:47:55

相关推荐

查询oracle表空间有什么数据 oracle查询表空间使用情况与查询有哪些数据库实例在运行...

select a.tablespace_name "表空间名称",

100-round((nvl(b.bytes_free,0)/a.bytes_alloc)*100,2) "占用率(%)",

round(a.bytes_alloc/1024/1024,2) "容量(M)",

round(nvl(b.bytes_free,0)/1024/1024,2) "空闲(M)",

round((a.bytes_alloc-nvl(b.bytes_free,0))/1024/1024,2) "使用(M)",

Largest "最大扩展段(M)",

to_char(sysdate,'yyyy-mm-dd hh24:mi:ss') "采样时间"

from (select f.tablespace_name,

sum(f.bytes) bytes_alloc,

sum(decode(f.autoextensible,'YES',f.maxbytes,'NO',f.bytes)) maxbytes

from dba_data_files f

group by tablespace_name) a,

(select f.tablespace_name,

sum(f.bytes) bytes_free

from dba_free_space f

group by tablespace_name) b,

(select round(max(ff.length)*16/1024,2) Largest,

ts.name tablespace_name

from sys.fet$ ff, sys.file$ tf,sys.ts$ ts

where ts.ts#=ff.ts# and ff.file#=tf.relfile# and ts.ts#=tf.ts#

group by ts.name, tf.blocks) c

where a.tablespace_name = b.tablespace_name and a.tablespace_name = c.tablespace_name

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。