Forked from rakeshsingh/Oracle Script - Check Tablespace Size.sql
Created
March 21, 2018 20:05
-
-
Save PrabhaAnde/70a08fd17485c8f85c535e59b5ee9f38 to your computer and use it in GitHub Desktop.
Oracle Script - Check 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 /* + RULE */ | |
df.tablespace_name AS "Tablespace" | |
,df.bytes / (1024 * 1024 * 1024) AS "Size (GB)" | |
,Trunc(fs.bytes / (1024 * 1024 * 1024)) AS "Free (GB)" | |
FROM ( | |
SELECT tablespace_name | |
,Sum(bytes) AS bytes | |
FROM dba_free_space | |
GROUP BY tablespace_name | |
) fs | |
,( | |
SELECT tablespace_name | |
,SUM(bytes) AS bytes | |
FROM dba_data_files | |
GROUP BY tablespace_name | |
) df | |
WHERE fs.tablespace_name = df.tablespace_name | |
ORDER BY 3 DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment