Created
July 2, 2018 15:31
-
-
Save valtoni/2866b3438e905a5617a445b3f27a6a26 to your computer and use it in GitHub Desktop.
Shows oracle tablespace free space
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 | |
| fs.tablespace_name "Tablespace", | |
| (df.totalspace - fs.freespace) "Used MB", | |
| fs.freespace "Free MB", | |
| df.totalspace "Total MB", | |
| round(100 * (fs.freespace / df.totalspace)) "Pct. Free" | |
| from | |
| (select | |
| tablespace_name, | |
| round(sum(bytes) / 1048576) TotalSpace | |
| from | |
| dba_data_files | |
| group by | |
| tablespace_name | |
| ) df, | |
| (select | |
| tablespace_name, | |
| round(sum(bytes) / 1048576) FreeSpace | |
| from | |
| dba_free_space | |
| group by | |
| tablespace_name | |
| ) fs | |
| where | |
| df.tablespace_name = fs.tablespace_name; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment