Tuesday, February 5, 2019

Find Freespace in Tablespace with Datafiles:

SELECT dd.tablespace_name TABLESPACE_NAME,
dd.file_name FILE_NAME,
dd.bytes/1024/1024||' MB' TOTAL,
SUM(fs.bytes)/1024/1024||' MB' FREE
FROM sys.dba_free_space fs, sys.dba_data_files dd
WHERE dd.tablespace_name = fs.tablespace_name
AND dd.file_id = fs.file_id
GROUP BY dd.tablespace_name, dd.file_name, dd.bytes/1024
ORDER BY dd.tablespace_name, dd.file_name;

No comments:

Post a Comment