Database 11g

Tuesday, October 27, 2015

How to check Tablespace Space in MB




 column "Tablespace" format a13
 column "Used MB"    format 99,999,999
 column "Free MB"    format 99,999,999
 column "Total MB"   format 99,999,999
 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;

Tablespace        Used MB     Free MB      Total MB               Pct. Free
------------- ----------- ----------- ----------- -------------------------------------
SYSAUX              1,191          857                2,048                     42
UNDOTBS1          70              5,050             5,120                     99
USERS                  10,218       20,502           30,720                    67
SYSTEM               914            1,134             2,048                      55
UNDOTBS2          71              5,049             5,120                      99


Happy Learning ...

No comments:

Post a Comment