Größe der Tablespaces anzeigen

Immer wieder muss man benötigt man eine Übersicht, wie viel Platz welche Tablespaces einnehmen.

sqlplus / as sysdba

--SQL
SELECT df.tablespace_name "Tablespace",
  totalusedspace "Used MB",
  (df.totalspace - tu.totalusedspace) "Free MB",
  df.totalspace "Total MB",
  round(100 * ((df.totalspace - tu.totalusedspace) / df.totalspace)) "% Free"
FROM (select tablespace_name,
  round(sum(bytes) / 1048576) TotalSpace
    FROM dba_data_files 
    GROUP BY tablespace_name) df,
      (SELECT round(sum(bytes) / (1024*1024)) totalusedspace, tablespace_name
          FROM dba_segments 
          GROUP BY tablespace_name) tu
WHERE df.tablespace_name = tu.tablespace_name 
AND df.totalspace <> 0
ORDER BY "Tablespace";