To use space optimally, it is better to use standardized file sizes that are multiples of DB_BLOCK_SIZE and also multiples of OS_STRIPE_SIZE. For example, suppose you want to create a data file of 1000MB. Here is the calculation:
If BLOCK SIZE = 8K, the total number of blocks available=(1000/8)*1024, which is 128000 blocks in this case. The first block of every data file does not contain user data--it contains the file header used for storing internal information such as current SCN, checkpoint structure, etc. Subtract this block from the calculation. Thus, the net total number of blocks available for insertion is 12800-1 = 127999 blocks.
As Oracle recommends, INITIAL / NEXT extents should be multiples of DB_BLOCK_SIZE. So, let us consider PCT_INCREASE = 0. Then the number of blocks corresponding to initial /next extent size is as follows:
Initial/Next Extent Size 1Mb 10Mb 16Mb Number of Blocks 128 1280 2048
We know the total number of blocks available for insertion is 127999 which is not a factor of the number of blocks we calculated above in the table. So parts of the bytes are wasted.
Now let us say you created a data file of 1000Mb + 8KB = 1024008 Kb instead of 1000Mb. The calculation goes as follows:
Total number of blocks available = (1024008/8) = 128001 blocks. Net total number of blocks available for insertion = 128001 - 1 = 12800 blocks. 12800 is a factor
For More Information
- What do you think about this tip? E-mail us at editor@searchDatabase.com with your feedback.
- The Best Oracle Web Links: tips, tutorials, scripts, and more.
- Have an Oracle tip to offer your fellow DBA's and developers? The best tips submitted will receive a cool prize--submit your tip today!
- Ask your technical Oracle questions--or help out your peers by answering them--in our live discussion forums.
- Ask the Experts yourself: Our Oracle gurus are waiting to answer your toughest questions.
This was first published in May 2001