查询表空间使用情况SQL,如下:

select f.tablespace_name, a.total, a.total-f.free use, round((1-(f.free / a.total)) * 100) "% use"from (select tablespace_name, sum(bytes / (1024 * 1024)) total from dba_data_files group by tablespace_name) a, (select tablespace_name, round(sum(bytes / (1024 * 1024))) free from dba_free_space group by tablespace_name) fWHERE a.tablespace_name = f.tablespace_name( )order by "% use";