Site icon IT Tutorial

Oracle Top Tables Segment Size and Schema Size Scripts

Hi,

You want to learn which table is biggest in database or which schema is biggest in database.

 

You can learn Top Schema of database and Schema size with following script.

SELECT * FROM (
SELECT OWNER, SUM(BYTES)/1048576 MB 
from DBA_SEGMENTS 
GROUP BY OWNER 
ORDER BY MB DESC)
WHERE ROWNUM < 20;

 

You can learn Top segment of database and Table size with following script.

SELECT * FROM (
SELECT SEGMENT_NAME,SEGMENT_TYPE, round(SUM(BYTES)/power(2,20)) SEGMENT_SIZE
FROM DBA_SEGMENTS
GROUP BY SEGMENT_NAME, SEGMENT_TYPE
ORDER BY 3 desc)
WHERE ROWNUM < 31;

 

 

Do you want to learn Oracle Database Performance Tuning detailed, then read the following articles.

https://ittutorial.org/oracle-database-performance-tuning-tutorial-12-what-is-the-automatic-sql-tuning-and-how-to-automated-sql-tuning/ 

 1,117 views last month,  1 views today

Exit mobile version