Friday 26 June 2015

How to Check the tablespace name, size, percentage free?

SQL> 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 ;

Tablespace                             Used MB    Free MB      Total MB     Pct. Free
------------------------------ ----------    ----------     ----------    ----------
SYSAUX                                879           935              1814             52
UNDOTBS1                           181           5107            5288            97
USERS                                   6086          4184           10270          41
SYSTEM                                758           1026            1784           58


No comments:

Post a Comment