preloader
blog-post

Query to find the space used by a table in Oracle

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 this blog:
Comments

Related Articles