Answers for "size of all tables in a schema oracle"

SQL
1

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;
Posted by: Guest on July-11-2021
0

oracle size of tables in schema

-- Oracle: Size of a table in a tablespace
SELECT
    e.owner,
    e.segment_name,
    e.tablespace_name,
    SUM(e.bytes) / 1048576 megs
FROM dba_extents e
WHERE
    e.owner = 'xxMY_OWNERxx'
    AND e.tablespace_name = 'xxMY_TBSxx'
    AND e.segment_name = 'xxMY_TABLExx'
GROUP BY e.owner, e.segment_name, e.tablespace_name
ORDER BY
    e.tablespace_name,
    e.segment_name;
Posted by: Guest on January-18-2021

Code answers related to "size of all tables in a schema oracle"

Code answers related to "SQL"

Browse Popular Code Answers by Language