dfree.sql

rem  dfree.sql
rem
rem  linesize = 55
rem
ttitle 'Free Space by Tablespace'
rem
col tablespace_name format a15 heading 'TABLESPACE'
col file_id format 9999 heading 'ID'
col block_id format 999999 heading 'BLOCK ID'
col bytes format 99,999,999,999
col blocks format 999,999
col rownum format 9999
rem
break on report on tablespace_name skip 1
compute sum of bytes blocks on report tablespace_name
rem
select tablespace_name, file_id, block_id, bytes, blocks, rownum
  from sys.dba_free_space
  where tablespace_name like nvl(upper('&tablespace'),'%')
 order by tablespace_name, rownum;