S-LECT /-+ use_nl(x y)*-
t.tablespace_name "Tablespace",
t.status "Status",
x.tsize "Size (MB)",
x.used "Used (MB)",
x.usedrate "UsedRate (%)" ,
t.initial_extent "Initial Ext",
NVL(t.next_extent,0) "Next Ext",
t.min_extents "Min Exts",
t.max_extents "Max Exts",
NVL(t.pct_increase,0) "Pct Increase",
x.dfname "Datafile name",
y.min_pec "Coalesced (%)"
from
(SELECT
d.tablespace_name as Tspace,
Round(MAX(d.bytes)/1024/1024) as TSize ,
ROUND((MAX(d.bytes)/1024/1024) - (SUM(decode(f.bytes, NULL,0, f.bytes))/1024/1024),2) as Used ,
Round((MAX(d.bytes) - SUM(decode(f.bytes, NULL,0, f.bytes)))/MAX(d.bytes)*100,2) as UsedRate ,
SUBSTR(d.file_name,1,80) as DFNAME
FROM DBA_FREE_SPACE f , DBA_DATA_FILES d
WHERE f.tablespace_name(+) = d.tablespace_name
AND f.file_id(+) = d.file_id
GROUP BY d.tablespace_name ,d.file_name
ORDER BY d.tablespace_name ) x, DBA_TABLESPACES t,
(select tablespace_name,min(percent_extents_coalesced) as min_pec from dba_free_space_coalesced group by tablespace_name) y
WHERE t.tablespace_name = x.tspace
AND x.tspace = y.TABLESPACE_NAME
order by t.tablespace_name
;
최근 덧글