Oracle
 sql >> Base de données >  >> RDS >> Oracle

Taille réelle de l'espace de table dans Oracle

Essayez ceci :

-- Available space, by tablespace

SELECT * FROM
  (SELECT tablespace_name FROM dba_tablespaces)
LEFT OUTER JOIN
  (SELECT tablespace_name, SUM(bytes) AS total_bytes
     FROM dba_data_files
     GROUP BY tablespace_name)
  USING (tablespace_name)
LEFT OUTER JOIN
  (SELECT tablespace_name, sum(bytes) AS used_bytes
     from dba_segments
     GROUP BY tablespace_name)
  USING (tablespace_name)
LEFT OUTER JOIN
  (SELECT tablespace_name, SUM(bytes) AS free_bytes
     FROM dba_free_space
     GROUP BY tablespace_name)
  USING (tablespace_name);