1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| select e.tablespace_name, max(total) total, sum(decode(e.status,'ACTIVE',G,0)) active, sum(decode(e.status,'UNEXPIRED',G,0)) unexpired, sum(decode(e.status,'EXPIRED',G,0)) expired, round((sum(decode(e.status,'ACTIVE',G,0))+sum(decode(e.status,'UNEXPIRED',G,0)))/max(total)*100,2) real_use_pct from (select tablespace_name,round(sum(bytes)/1024/1024/1024,2) total from dba_data_files group by tablespace_name) f, (SELECT tablespace_name,status,round(SUM(bytes)/1024/1024/1024,2) G from dba_undo_extents group by tablespace_name,status) e where f.tablespace_name=e.tablespace_name group by e.tablespace_name;
|