Hi,
Try this one:
-- ts_size.sql
set pages 49999 lin 120
col tablespace_name for a32 tru
col "Total GB" for 999,999.9
col "GB Used" for 999,999.9
col "GB Free" for 99,999.9
col "Pct Free" for 999.9
col "Pct Used" for 999.9
comp sum of "Total GB" on report
comp sum of "GB Used" on report
comp sum of "GB Free" on report
break on report
Select A.Tablespace_Name, B.Total/1024/1024/1024 "Total GB",
(B.Total-a.Total_Free)/1024/1024/1024 "GB Used",
A.Total_Free/1024/1024/1024 "GB Free",
(A.Total_Free/B.Total) * 100 "Pct Free",
((B.Total-A.Total_Free)/B.Total) * 100 "Pct Used"
From (Select Tablespace_Name, Sum(Bytes) Total_Free
From Sys.Dba_Free_Space
Group By Tablespace_Name ) A
, (Select Tablespace_Name, Sum(Bytes) Total
From Sys.Dba_Data_Files
Group By Tablespace_Name ) B
Where A.Tablespace_Name LIKE 'ZEUS%'
And A.Tablespace_Name = B.Tablespace_Name
Thanks,
Balaram