clear breaks clear computes column "Total Bytes" format 999,999,999,999 column "Bytes Free" format 999,999,999,999 column "% Free" format 999.99 break on report compute sum of "Total Bytes" on report compute sum of "Bytes Free" on report compute avg of "% Free" on report select substr(fs.FILE_ID,1,3) "ID#", fs.tablespace_name, df.bytes "Total Bytes", sum(fs.bytes) "Bytes Free", (100*((sum(fs.bytes))/df.bytes)) "% Free" from sys.dba_data_files df, sys.dba_free_space fs where df.file_id(+) = fs.file_id group by fs.FILE_ID, fs.tablespace_name, df.bytes, df.blocks order by fs.tablespace_name;