SELECT A.TABLESPACE_NAME,Trunc(A.USED_BLOCKS*8/1024) USED_MB,Trunc(B.TOTAL_BLOCKS*8/1024) TOTAL_MB,Trunc(USED_BLOCKS/TOTAL_BLOCKS,3)*100 USED_PCT
FROM
(
SELECT TABLESPACE_NAME,Sum(BLOCKS) USED_BLOCKS FROM dba_extents GROUP BY TABLESPACE_NAME
)A,
(
SELECT TABLESPACE_NAME,Sum(GREATEST(BLOCKS,MAXBLOCKS)) TOTAL_BLOCKS FROM dba_data_files GROUP BY TABLESPACE_NAME
)B
WHERE A.TABLESPACE_NAME=B.TABLESPACE_NAME
ORDER BY USED_PCT DESC;