Get Table Sizes in your Schema

If you want to see how much space your tables are taking in the database, log in to the shcema and execute this SQL.

SELECT   segment_name table_name, MAX (tablespace_name) tablespace_name,
         SUM
(BYTES) / (1024 * 1024) table_size_mb
   
FROM user_extents
   
WHERE segment_name IN (SELECT tname
                           
FROM tab
                           
WHERE tabtype = 'TABLE')
GROUP BY segment_name
ORDER BY tablespace_name

The Above query tells you the table name, the table space it is residing in and the size in MB.

转载于:https://www.cnblogs.com/GoDevil/archive/2008/08/07/1262749.html

你可能感兴趣的:(Get Table Sizes in your Schema)