Posts Tagged ‘table size’

Actual size of tables for tablespaces

November 5th, 2011 No comments

The size of a table can be found using oracle’s segment tables. Basically following code block returns a result of table size within related tablespaces in terms of MB and GB:

   SELECT tablespace_name,
          segment_name AS TABLENAME,
          trunc((sum(BYTES) / 1024 / 1024), 2) MB,
          trunc((sum(BYTES) / 1024 / 1024 / 1024), 2) GB
     FROM user_segments
 GROUP BY tablespace_name, segment_name

This way you may access only the tablespaces of logged in user

VN:F [1.9.22_1171]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.22_1171]
Rating: +8 (from 10 votes)