Created
November 22, 2011 13:35
-
-
Save felclef/1385671 to your computer and use it in GitHub Desktop.
Como obter o informações de tablespaces e seus tamanhos... SQL-zado de forma legível, não aquela m. de (+) etc
This file contains 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 | |
ts.tablespace_name as "Tablespace", | |
round(sum(df.bytes) / (1024*1024), 2) as "Total (MB)", | |
round(sum(df.bytes) / (1024*1024) - sum(fs.bytes) / (1024*1024), 2) as "Usado (MB)", | |
round(sum(fs.bytes) / (1024*1024), 2) as "Livre (MB)", | |
round(sum(fs.bytes) / sum(df.bytes) * 100, 4) as "Livre (%)", | |
100 - round(sum(fs.bytes) / sum(df.bytes) * 100, 4) as "Usado (%)" | |
from | |
dba_tablespaces ts | |
inner join dba_data_files df | |
on df.tablespace_name = ts.tablespace_name | |
inner join dba_free_space fs | |
on fs.tablespace_name = ts.tablespace_name | |
--where tablespace_name like 'GISACTP' | |
group by | |
ts.tablespace_name | |
order by | |
"Usado (%)" desc | |
/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment