27 Mar 2013

Oracle 10 G Table Space Kullanımı


SELECT
df.tablespace_name tspace,
round(df.bytes / (1024 * 1024)) tot_ts_size,
round(SUM(fs.bytes) / (1024 * 1024)) free_ts_size,
nvl(round(SUM(fs.bytes) * 100 / df.bytes),
1) ts_pct,
round((df.bytes - SUM(fs.bytes)) * 100 / df.bytes) ts_pct1
FROM dba_free_space fs,
(SELECT tablespace_name,
SUM(bytes) bytes
FROM dba_data_files
GROUP BY tablespace_name) df
WHERE fs.tablespace_name(+) = df.tablespace_name
GROUP BY df.tablespace_name,
df.bytes
UNION ALL
SELECT
df.tablespace_name tspace,
fs.bytes / (1024 * 1024) tot_ts_size,
SUM(df.bytes_free) / (1024 * 1024) free_ts_size,
nvl(round((SUM(fs.bytes) - df.bytes_used) * 100 / fs.bytes),
1) ts_pct,
round((SUM(fs.BYTES) - df.BYTES_free) * 100 / fs.bytes) ts_pct1
FROM dba_temp_files fs,
(SELECT tablespace_name,
bytes_free,
bytes_used
FROM V$temp_space_header
GROUP BY tablespace_name,
bytes_free,
bytes_used) df
WHERE fs.tablespace_name(+) = df.tablespace_name
GROUP BY df.tablespace_name,
fs.bytes,
df.bytes_free,
df.BYTES_used
ORDER BY 2 DESC

Faruk Hocama teşekkürler
http://www.farukazakli.blogspot.com/

Yada enterprise manager dan  grafikli olarak izleyebilirsiniz.