失眠网,内容丰富有趣,生活中的好帮手!
失眠网 > oracle怎么查询临时表空间大小 如何查看oracle临时表空间当前使用了多少空间的大小...

oracle怎么查询临时表空间大小 如何查看oracle临时表空间当前使用了多少空间的大小...

时间:2022-08-17 01:34:36

相关推荐

oracle怎么查询临时表空间大小 如何查看oracle临时表空间当前使用了多少空间的大小...

-03-09 回答

查看“oracle”临时表空间当前使用了多少空间,可按照以下程序。

select d.tablespace_name "name", d.status "status",

to_char (nvl (a.bytes / 1024 / 1024, 0), '99,999,990.90') "size (m)",

to_char (nvl (a.bytes - nvl (f.bytes, 0), 0) / 1024 / 1024,

'99999999.99'

) use,

to_char (nvl ((a.bytes - nvl (f.bytes, 0)) / a.bytes * 100, 0),

'990.00'

) "used %"

from sys.dba_tablespaces d,

(select tablespace_name, sum (bytes) bytes

from dba_data_files

group by tablespace_name) a,

(select tablespace_name, sum (bytes) bytes

from dba_free_space

group by tablespace_name) f

where d.tablespace_name = a.tablespace_name(+)

and d.tablespace_name = f.tablespace_name(+)

and not (d.extent_management like 'local' and d.contents like 'temporary')

union all

select d.tablespace_name "name", d.status "status",

to_char (nvl (a.bytes / 1024 / 1024, 0), '99,999,990.90') "size (m)",

to_char (nvl (t.bytes, 0) / 1024 / 1024, '99999999.99') use,

to_char (nvl (t.bytes / a.bytes * 100, 0), '990.00') "used %"

from sys.dba_tablespaces d,

(select tablespace_name, sum (bytes) bytes

from dba_temp_files

group by tablespace_name) a,

(select tablespace_name, sum (bytes_cached) bytes

from v$temp_extent_pool

group by tablespace_name) t

where d.tablespace_name = a.tablespace_name(+)

and d.tablespace_name = t.tablespace_name(+)

and d.extent_management like 'local'

and d.contents like 'temporary';

如果觉得《oracle怎么查询临时表空间大小 如何查看oracle临时表空间当前使用了多少空间的大小...》对你有帮助,请点赞、收藏,并留下你的观点哦!

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