Question: I to know the size of my Oracle
database. Is there a table that shows the total size of an
Answer: There are several ways to
measure the size of an Oracle database:
1 - The size of the Oracle database files can be computed
-- get database size from v$datafile:
-- get Oracle database size from
- "Free_Space(MB)" "Used_Space(MB)","Free_Space(MB)"
(select sum(bytes/(1014*1024)) from
sum(bytes/(1024*1024)) from dba_free_space) "Free_Space(MB)"
2 - The size of the sum of table extents
segment_name = 'MYTAB'
See code depot for full scripts.
3 - The sum of the size of the data within the tables
You can also compute the size of an Oracle database over
Oracle 10g and beyond we have the dba_hist_seg_stat
table with a wealth of information about all active segments
within the database, including the space usage in the
space_allocated_total and space_used_total
script will show "spaced used total" (total size) for a
specific Oracle table, essentially computing the Oracle
table size over time: