set pages 50000
SET LINESIZE 190
COLUMN "Tablespace" FORMAT a35
COLUMN "Used MB" FORMAT 99,999,999
COLUMN "Free MB" FORMAT 99,999,999
COLUMN "Total MB" FORMAT 99,999,999
SELECT fs.tablespace_name "Tablespace",
(df.totalspace - fs.freespace) "Used MB",
fs.freespace "Free MB",
df.totalspace "Total MB",
ROUND(100 * (fs.freespace / df.totalspace)) "Pct. Free"
FROM (SELECT tablespace_name,
ROUND(SUM(bytes) / 1048576) TotalSpace
FROM dba_data_files
GROUP BY tablespace_name) df,
(SELECT tablespace_name,
ROUND(SUM(bytes) / 1048576) FreeSpace
FROM dba_free_space
GROUP BY tablespace_name) fs
WHERE df.tablespace_name = fs.tablespace_name
ORDER BY "Pct. Free" ASC;
Comments
Post a Comment