SELECT * FROM (SELECT SEGMENT_NAME, SUM(BYTES) / 1024 / 1024 MB FROM DBA_SEGMENTS WHERE TABLESPACE_NAME = 'SYSTEM' GROUP BY SEGMENT_NAME ORDER BY 2 DESC) WHERE ROWNUM < 10;
查询一下system空间占用比
1 2 3 4 5 6 7
SELECT B.TABLESPACE_NAME "表空间", B.BYTES / 1024 / 1024 "大小M", (B.BYTES - SUM(NVL(A.BYTES, 0))) / 1024 / 1024 "已使用M", SUBSTR((B.BYTES - SUM(NVL(A.BYTES, 0))) / (B.BYTES) * 100, 1, 5) "利用率" FROM DBA_FREE_SPACE A, DBA_DATA_FILES B WHERE A.FILE_ID = B.FILE_ID AND B.TABLESPACE_NAME = 'SYSTEM' GROUP BY B.TABLESPACE_NAME, B.FILE_NAME, B.BYTES ORDER BY B.TABLESPACE_NAME;
查询AUD$占用空间
1 2 3
SELECT SEGMENT_NAME, BYTES / 1024 / 1024 "占用空间M" FROM DBA_SEGMENTS WHERE SEGMENT_NAME = 'AUD$';