views:

206

answers:

5

I'm trying to figure out how big a certain database would be (it hasn't been created yet). I know how many rows and what the tables will be. Is there a feature in Oracle that will tell me the size of such a theoretical database? Is there a known math formula I can use? I know there is a feature to determine the size of an existing database, but I want to know how big it will be before I create it.

+3  A: 

you can from the size of the data types for the columns in a table. You can then get a rough estimate of the size of a row in that table. then for 1 to n tables, then for 1 row in 1 table for x rows in x tables = estimate of the database for a given rowsize.

Long handed I know but this is how i normally do this.

+6  A: 

You might try prototyping your design - create an initial version of the database and write some scripts (or use a tool) to populate the tables with a reasonable amount of data. Then you will know for sure how much space X rows takes up. If it's too much, you can go back to the drawing board with your design. I know you want a figure before creating the database, but you'll never be able to account for everything that's going on with the physical data files under the hood.

Eric Z Beard
+1  A: 

To be accurate, this can get really complex. For example, this is how you do it on MS SQL Server:

http://msdn.microsoft.com/en-us/library/aa933068(SQL.80).aspx

Stu
A: 

Having an exact size wasn't too important, so I went with littlegeek's method. I figured out what my tables and columns would be, and looked up the sizes of the data types, then did some good 'ole multiplying.

bpapa
+1  A: 

You also need to include indexes in your estimates. I've seen systems where the indexes were as big as the data. The only way I would trust the answer is to do prototyping like Eric Z Beard suggests. Different datbase systems have different overhead, but they all have it.

bruceatk