Query to find the space used by a table

  • Home
  • /
  • Query to find the space used by a table
Query to find the space used by a table

Query to find the space used by a table

Oracle 15 Apr 2018

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;
Share: