Tuesday, February 17, 2009

Script to find tablespace free space in a database

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
and a.tablespace_name='SYSTEM'
ORDER BY a.tablespace_name;

1 comment:

Prem Kumar said...

Hello..

It is a standard query and also i've mentioned in my profile that i have collected some of the information from various blogs"...
In Oracle, there is something to learn for anyone...