The script will list the space usage per data file and orders them descending by usage percentage. select fn.file_name filename, fn.tablespace_name tsname, ff.free_space free_space, fn.bytes / 1000000 All_space, fn.bytes / 1000000 - ff.free_space used_space, 1 - ff.free_space / (fn.bytes / 1000000) used_pct from sys.dba_data_files fn, file_free ff where fn.file_id = ff.file_id order by used_pct desc ;
select fn.file_name filename, fn.tablespace_name tsname, ff.free_space free_space, fn.bytes / 1000000 All_space, fn.bytes / 1000000 - ff.free_space used_space, 1 - ff.free_space / (fn.bytes / 1000000) used_pct from sys.dba_data_files fn, file_free ff where fn.file_id = ff.file_id order by used_pct desc ;