Use following query to find out how much database space is cosumed by which tablespace in a database. With slight modifications the query can also show the space in MB:
select nvl(b.tablespace_name,nvl(a.tablespace_name,'UNKOWN')) name
, Gbytes_alloc Gbytes
, (Gbytes_alloc-nvl(Gbytes_free,0)) used
, nvl(Gbytes_free,0) free
, ((Gbytes_alloc-nvl(Gbytes_free,0))/Gbytes_alloc)*100 pct_used
, nvl(largest,0) largest
from
( select sum(bytes)/1024/1024/1024 Gbytes_free
, max(bytes)/1024/1024/1024 largest
, tablespace_name
from sys.dba_free_space
group by tablespace_name ) a
, ( select sum(bytes)/1024/1024/1024 Gbytes_alloc
, tablespace_name from sys.dba_data_files
group by tablespace_name ) b
where a.tablespace_name (+) = b.tablespace_name
order by 1
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment