Friday, August 13, 2010

See free and allocated space in datafiles

Useful data dictionary tables:
1.dba_free_space
2.dba_data_files



SELECT a.tablespace_name,a.file_name,a.bytes/1024/1024 allocated_mb,b.free_mb
FROM dba_data_files a,
(SELECT file_id, SUM(bytes/1024/1024) free_mb
FROM dba_free_space
GROUP BY file_id) b
WHERE a.file_id=b.file_id

No comments:

Post a Comment