Select df.tablespace_name, round (df.total_space / 1048576, 0) "Total space (MB)", round (df.total_space &NBSP;-&NBSP;NVL (fs.free_space, 0)) / 1048576, 0) "Used space (MB)", round (NVL (fs.free_space, 0) / 1048576, 0) "Free Space (MB), round (100 * (1&NBSP;-&NBSP;NVL (Fs.free_space, 0) ( / df.total_space), 2) "%used", to_char ( sysdate, ' Yyyy-mm-dd hh24:mi ') Stat_Time from (Select tablespace_name, sum (bytes) total_space from dba_ Data_files group by tablespace_name) &NBSP;DF, (Select b.tablespace_name, sum (b.bytes) free_space from dba_free_space b group by b.tablespace_name) fs where df.tablespace_name = Fs.tablespace_name (+) and exists (select * from dba_tablespaces ts where ts.contents <> ' temporary ' and ts.tablespace_name = df.tablespace_name) Unionselect df.tablespace_ Name, round (df.total_space / 1048576, 0) "Total space (MB) ", round (NVL (us.used_space, 0) / 1048576, 0) "Used space (MB)", round ((DF.TOTAL_SPACE&NBSP;-&NBSP;NVL (us.used_space, 0)) / 1048576, 0) "Free space (MB)", round (100 * (NVL (us.used_space, 0) / df.total_space), 2) "%used", to_char (sysdate, ' Yyyy-mm-dd hh24:mi ') Stat_Time from (select tablespace_name, sum (bytes) total_space from dba_temp_files group by Tablespace_name) df, (Select b.tablespace_name, sum ( b.bytes_cached) used_space from v$temp_ Extent_pool b group by b.tablespace_name) us where df. Tablespace_name = us.tablespace_name (+) and exists (select * from dba_tablespaces ts where ts.contents = ' temporary ' and ts.tablespace_name = df.tablespace_name) order by 5 desc;!
This article is from the "Beijing-East" blog, please be sure to keep this source http://bjdong.blog.51cto.com/507460/1718632
Querying database table Spaces