Created
December 20, 2011 17:52
-
-
Save brianstorti/1502497 to your computer and use it in GitHub Desktop.
Oracle tablespace size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select a.TABLESPACE_NAME, | |
a.BYTES bytes_used, | |
b.BYTES bytes_free, | |
b.largest, | |
round(((a.BYTES-b.BYTES)/a.BYTES)*100,2) percent_used | |
from | |
( | |
select TABLESPACE_NAME, | |
sum(BYTES) BYTES | |
from dba_data_files | |
group by TABLESPACE_NAME | |
) | |
a, | |
( | |
select TABLESPACE_NAME, | |
sum(BYTES) BYTES , | |
max(BYTES) largest | |
from dba_free_space | |
group by TABLESPACE_NAME | |
) | |
b | |
where a.TABLESPACE_NAME=b.TABLESPACE_NAME | |
order by ((a.BYTES-b.BYTES)/a.BYTES) desc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment