📜  架构 oracle 中所有表的大小 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:24.290000             🧑  作者: Mango

代码示例1
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;