Tuesday, May 6, 2014

How to find tablespace size in oralc database.

Using this query you can find out you tablespace size and used percentage.

SQL> SELECT DF.TABLESPACE_NAME, SUM(DF.BYTES)/1024/1024 "Total Size (MB)", SUM(FS.BYTES)/1024/1024 "Total Free (MB)",
  2  TRUNC(((SUM(FS.BYTES)/(SUM(DF.BYTES))*100)),1)||'%' "Free Percent"
  3  FROM DBA_DATA_FILES DF, DBA_FREE_SPACE FS
  4  WHERE FS.TABLESPACE_NAME=DF.TABLESPACE_NAME
  5  AND DF.TABLESPACE_NAME NOT IN ('USERS','UNDOTBS1','SYSAUX','SYSTEM')
  6  GROUP BY DF.TABLESPACE_NAME;

TABLESPACE_NAME                Total Size (MB) Total Free (MB) Free Percent
------------------------------ --------------- --------------- -----------------------------------------
DATABAK                                    512             511 99.8%
MIG_BCBL                                  1024            1023 99.9%
ORBLOG                                    1024         801.375 78.2%
ORBIND                                 1072104         1163.25 .1%
RECLAIM_TS                                  52          1.5625 3%
DATA                                      9920        758.4375 7.6%

TABLESPACE_NAME                Total Size (MB) Total Free (MB) Free Percent
------------------------------ --------------- --------------- -----------------------------------------
ORBSYS                                    2048         1012.75 49.4%
EXAMPLE                                    300         21.5625 7.1%
ORBDT2                                    1024             626 61.1%
ORBMAV                                    2048         987.625 48.2%
ORBIMG                                    3324             181 5.4%
SHRINK_TEST                                  5               4 80%
ORBMAS                                    1024        788.8125 77%
ORBDT3                                    2248          58.875 2.6%
TBSTRAN                                   3072         1022.25 33.2%
ORBITS                                    9216        262.6875 2.8%

24 rows selected.

No comments:

Post a Comment