Oracle Tablespace 空間查詢
2013-07-31 16:01
SQL> select a.TABLESPACE_NAME, to_char(a.BYTES/(1024*1024),'999,999') "Size(MB)", to_char(round((a.BYTES-b.BYTES)/(1024*1024),0),'999,999') "Used(MB)", to_char(b.BYTES/(1024*1024),'999,999') "Avail(MB)" from (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) b where a.TABLESPACE_NAME=b.TABLESPACE_NAME;
TABLESPACE_NAME Size(MB) Used(MB) Avail(MB)
------------------------------ -------- -------- ---------
SYSAUX 600 187 414
UNDOTBS1 360 33 327
USERS 3,105 2,909 197
SYSTEM 700 485 215
TBS_STRM 2,048 3 2,045
TBS_VOIP 4,096 1 4,095
6 rows selected.