Getting the Size of a Database



>> Wednesday, March 9, 2011

I recently needed to get an estimated size of an Oracle database. It turns out to be not too hard.

--by table
select table_name, num_rows, avg_row_len,
ROUND((num_rows * avg_row_len / 1048576),2) "MB Used"
from user_tables
where num_rows > 0

--total
select SUM(ROUND((num_rows * avg_row_len / 1048576),2)) "Total MB Used"
from user_tables

0 comments:

Post a Comment

  © Blogger template Webnolia by Ourblogtemplates.com 2009

Back to TOP