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

2016-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';

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值