How to check free space in each datafile for each tablespace
break on table_space on free
col tablespace_name format a15
col file_name format format a50
col free_bytes format 999,999,999,990
col bytes allocated_bytes format 999,999,999,990
set pagesize 66
set lines 100
SELECT
a.tablespace_name,
a.file_name,
a.bytes allocated_bytes,
b.free_bytes
FROM
dba_data_files a,
(SELECT file_id, SUM(bytes) free_bytes
FROM dba_free_space b
GROUP BY file_id) b
WHERE
a.file_id=b.file_id
ORDER BY
a.tablespace_name;
Comments