Does anybody have tablespace freespace query which will give output in terms of maxsize and not size allocated ?
I had the query but somehow lost it somewhere
Moderator: Tim...
select (select decode(extent_management,'LOCAL','*',' ') ||
decode(segment_space_management,'AUTO','a ','m ')
from dba_tablespaces where tablespace_name = b.tablespace_name) || nvl(b.tablespace_name,
nvl(a.tablespace_name,'UNKOWN')) name,
MB_Allocated MB_Allocated,
MB_Allocated-nvl(Free_MB,0) used,
nvl(Free_MB,0) free,
((MB_Allocated-nvl(Free_MB,0))/
nvl(Max_MB,MB_Allocated))*100 pct_used,
nvl(Max_MB,MB_Allocated) Max_Size,
decode( Max_MB, 0, 0, (MB_Allocated/Max_MB)*100) pct_max_used
from ( select sum(bytes)/1048576 Free_MB,
max(bytes)/1048576 largest,
tablespace_name
from sys.dba_free_space
group by tablespace_name ) a,
( select sum(bytes)/1048576 MB_Allocated,
sum(maxbytes)/1048576 Max_MB,
tablespace_name
from sys.dba_data_files
group by tablespace_name
union all
select sum(bytes)/1048576 MB_Allocated,
sum(maxbytes)/1048576 Max_MB,
tablespace_name
from sys.dba_temp_files
group by tablespace_name )b
where a.tablespace_name (+) = b.tablespace_name
order by 1
/Return to Oracle Database Administration
Users browsing this forum: No registered users and 1 guest