--查看使用率 column TablespaceName format a40 heading 'Tablespace Name'! ~* y; a7 u, I( a+ E7 s9 g9 \
column TotalUsedBytes format 9,999,999,999 heading 'File Sizes|(K)'
5 @$ M' N' G3 ?# n c$ r; L column TotalFreeBytes format 9,999,999,999 heading 'Free Bytes|(K)'6 V/ u' ~4 }4 `7 v6 R7 t9 ^
column FreeRatio format 990.99 heading 'Free|(%)'
( @$ m i* W' A column TotalExtensibleBytes format 9,999,999,999 heading 'Extensible|Sizes (K)'
6 i4 l0 u- G- {- j: B column TotalExtends format 9999 heading 'Ext'
1 `5 z* R% M" u' T3 ?2 m& E+ Y compute sum label 'Total:' of TotalFreeBytes TotalUsedBytes TotalExtensibleBytes on report
2 h7 ^) A, W8 h @+ i break on report$ i7 ^, n; j0 O) U4 n
select b.TablespaceName,
" I0 [9 m3 W4 g2 W* }1 t- D$ { round(sum(b.UsedByte) / 1024) TotalUsedBytes,
, n5 v! B" x' T2 O round(sum(a.FreeByte) / 1024) TotalFreeBytes,
0 s( e% }$ i# o. H. E9 b2 u round(sum(b.ExtensibleByte) / 1024) TotalExtensibleBytes,
+ M2 G- B+ k( j7 o) @ round(sum(a.FreeByte + b.ExtensibleByte) * 100 / sum(b.UsedByte + b.ExtensibleByte), 2) FreeRatio,
3 M8 c3 y( d+ G+ Y* @ sum(a.Extend) TotalExtends
) N( b) f% a4 z$ B& p+ V/ m- [ from (select sum(bytes) FreeByte,( u) h4 \- O3 P- C) a8 m9 t
count(*) Extend,
6 c+ Z5 Q/ }1 G file_id FileID,+ j' U# i2 m1 O$ Z" ?
tablespace_name TablespaceName* u, P# u" B" y' V4 v: F$ U
from dba_free_space% p; R* Q0 i# K3 e; ]/ ^, B
group by file_id,8 n, h! b6 I K, T9 ?% Z
tablespace_name
9 C6 z# \# i: `0 E8 u union all
6 w# I5 y0 J Z/ P: Z* t( a3 ~ select sum(bytes_free) FreeByte,+ I5 G/ I! J/ c- Q7 Y
count(*) Extend,
' x9 V) s, f ?# A8 V8 v
2 y# F$ C _, ?# @4 K9 ]$ S$ X" f9 b file_id FileID, |