Query to find the space used by a table

Sunday, April 15, 2018

Query to find the space used by a table



Query to find the space used by a table

SELECT DS.TABLESPACE_NAME,
        SEGMENT_NAME,
        ROUND(SUM(DS.BYTES) / (1024 * 1024)) AS MB,
        ROUND(SUM(DS.BYTES) / (1024 * 1024 * 1024)) AS GB
   FROM DBA_SEGMENTS DS
  WHERE SEGMENT_NAME IN
        (SELECT TABLE_NAME
           FROM DBA_TABLES
          WHERE TABLE_NAME = 'REQUIRED_TABLE_NAME')
  GROUP BY DS.TABLESPACE_NAME, SEGMENT_NAME;

Error 404

The page you were looking for, could not be found. You may have typed the address incorrectly or you may have used an outdated link.

Go to Homepage