Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: tablespace calculating
Hi Paul
On Tue, 25 Sep 2001 11:48:08 +0200, "Paul Meier" <stefan.porges_at_berlin.de> wrote:
>could somebody please help. I dont know, how to calculate the needed
>tablespace.
>Sample table with 30 columns( 1 - column Number and 29 columns char(20) )
> initial data = 3000 rows
> average growth = 10 rows per day
It is unrealistic to expect to be able to calculate EXACT size requirements for tables. The basic formula I use for estimating column sizes are:
Number : (precision*2) +1 (+1 if negative) and round up
varchar: number of bytes actually used
char: size of definition
date: 7 bytes
Row Headers: 3+(numcols<250 bytes)+(3*numcols>=250 bytes)
Block Header Fixed: 57+23*(tables INITTRANS)
Block Header Variable: 4+(2*num rows in the block)
PCT Free must also be taken into account.
Having said the above and looking at the small number of rows you have in your table I would probably wave away all of the complications and estimate the table requirements as follows:
(29*20bytes)+(20 bytes or so for the number) = 600 bytes per row 600 bytes per row * 3000rows = 1,800,000 bytes or about 1.7 meg.
I would ignore the row header and block header requirements (and also PCT FREE unless its really large) and place the table in a tablespace set to throw 1 Meg extents and let it grow as needed. The table will grab an initial and next extent of 1M and will have some growing room in the second extent. For future proofing, just make sure there is always space to throw a couple of extents in the tablespace and you don't need to worry too much about it - its not growing all that fast.
Regards
Dale