Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

size of all tables in a schema oracle

SELECT sum(BYTES) / 1e6 AS SIZE_MB FROM DBA_SEGMENTS WHERE OWNER = 'schema_name';
-- By type
SELECT SEGMENT_TYPE, sum(BYTES) / 1e6 AS SIZE_MB FROM DBA_SEGMENTS
    WHERE OWNER = 'schema_name' GROUP BY SEGMENT_TYPE;
-- By schema
SELECT OWNER, sum(BYTES) / 1e6 AS SIZE_MB FROM DBA_SEGMENTS GROUP BY OWNER
    ORDER BY SIZE_MB DESC;
 
PREVIOUS NEXT
Tagged: #size #tables #schema #oracle
ADD COMMENT
Topic
Name
1+8 =