Created
August 8, 2013 13:03
-
-
Save arcayne/6184378 to your computer and use it in GitHub Desktop.
Useful queries on site
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 * FROM ( | |
SELECT | |
OWNER, SEGMENT_NAME, BYTES/1024/1024 SIZE_MB | |
FROM | |
DBA_SEGMENTS | |
WHERE | |
SEGMENT_TYPE = 'TABLE' | |
AND tablespace_name = 'HIST_DATA' | |
ORDER BY | |
BYTES/1024/1024 DESC ) WHERE ROWNUM <= 10; | |
select df.tablespace_name "Tablespace", | |
totalusedspace "Used MB", | |
(df.totalspace - tu.totalusedspace) "Free MB", | |
df.totalspace "Total MB", | |
round(100 * ( (df.totalspace - tu.totalusedspace)/ df.totalspace)) | |
"Pct. Free" | |
from | |
(select tablespace_name, | |
round(sum(bytes) / 1048576) TotalSpace | |
from dba_data_files | |
group by tablespace_name) df, | |
(select round(sum(bytes)/(1024*1024)) totalusedspace, tablespace_name | |
from dba_segments | |
group by tablespace_name) tu | |
where df.tablespace_name = tu.tablespace_name ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment