Thursday, 29 September 2016

Query to Find tablespace size

Hi,


Using below query ,we can find all table spaces sizes in respective Instance.


select b.tablespace_name, tbs_size Size_Gb, a.free_space Free_gb

from  (select tablespace_name, round(sum(bytes)/1024/1024/1024 ,2) as free_space

       from dba_free_space

       group by tablespace_name) a,

      (select tablespace_name, sum(bytes)/1024/1024/1024 as tbs_size

       from dba_data_files

       group by tablespace_name) b

where a.tablespace_name(+)=b.tablespace_name;