size of all tables in a schema oracle

Solutions on MaxInterview for size of all tables in a schema oracle by the best coders in the world

showing results for - "size of all tables in a schema oracle"
Sophie
18 Jun 2019
1SELECT sum(BYTES) / 1e6 AS SIZE_MB FROM DBA_SEGMENTS WHERE OWNER = 'schema_name';
2-- By type
3SELECT SEGMENT_TYPE, sum(BYTES) / 1e6 AS SIZE_MB FROM DBA_SEGMENTS
4    WHERE OWNER = 'schema_name' GROUP BY SEGMENT_TYPE;
5-- By schema
6SELECT OWNER, sum(BYTES) / 1e6 AS SIZE_MB FROM DBA_SEGMENTS GROUP BY OWNER
7    ORDER BY SIZE_MB DESC;
Sophie
19 Jul 2018
1-- Oracle: Size of a table in a tablespace
2SELECT
3    e.owner,
4    e.segment_name,
5    e.tablespace_name,
6    SUM(e.bytes) / 1048576 megs
7FROM dba_extents e
8WHERE
9    e.owner = 'xxMY_OWNERxx'
10    AND e.tablespace_name = 'xxMY_TBSxx'
11    AND e.segment_name = 'xxMY_TABLExx'
12GROUP BY e.owner, e.segment_name, e.tablespace_name
13ORDER BY
14    e.tablespace_name,
15    e.segment_name;