Finding appropriate block size?

Hi All,
I believe this might be basic question, How to find appropriate block size for building an database to an specific application?
I had seen always default 8K block size is used every where(Around 300-350 databases i have seen till now)....but why and how do they estimate this block size blindly before creating production database.
Also in the same way how memory settings are finalized before creating database?
-Yasser

Yasser,
I have been very fortunate to buy and read several very high quality Oracle books which not only correctly state the way something works, but also manage to provide a logical, reasoned explanation for why things happen as they do, when it is appropriate, and when it is not. While not the first book I read on the topic of Oracle, the book “Oracle Performance Tuning 101” by Gaja Vaidyanatha marked the start of logical reasoning in performance tuning exercises for me. A couple years later I learned that Gaja was a member of the Oaktable Network. I read the book “Expert Oracle One on One” by Tom Kyte and was impressed with the test cases presented in the book which help readers understand the logic of why Oracle behaves as it does, and I also enjoyed the performance tuning stories in the book. A couple years later I found Tom Kyte’s “Expert Oracle Database Architecture” book at a book store and bought it without a second thought; some repetition from his previous book, fewer performance tuning storing, but a lot of great, logically reasoned information. A couple years later I learned that Tom was a member of the Oaktable Network. I read the book “Optimizing Oracle Performance” by Cary Millsap, a book that once again marked a distinct turning point in the method I used for performance tuning – the logic made all of the book easy to understand. A couple years later I learned that Cary was a member of the Oaktable Network. I read the book “Cost-Based Oracle Fundamentals” by Jonathan Lewis, a book by its title seemed to be too much of a beginner’s book until I read the review by Tom Kyte. Needless to say, the book also marked a turning point in the way I approach problem solving through logical reasoning, asking and answering the question – “What is Oracle thinking”. Jonathan is a member of the Oaktable Network, a pattern is starting to develop here. At this point I started looking for anything written in book or blog form by members of the Oaktable Network. I found Richard Foote’s blog, which some how managed to make Oracle indexes interesting for me - probably through the use of logic and test cases which allowed me to reproduce what I reading about. I found Jonathan Lewis’ blog, which covers so many interesting topics about Oracle, all of which leverage logical approaches to help understanding. I also found the blogs of Kevin Closson, Greg Rahn, Tanel Poder, and a number of other members of the Oaktable Network. The draw to the performance tuning side of Oracle administration was primarily for a search for the elusive condition known as Compulsive Tuning Disorder, which was coined in the book written by Gaja. There were, of course, many other books which contributed to my knowledge – I reviewed at least 8 of the Oracle related books on the amazon.com website.
Motivation… it is interesting to read what people write about Oracle. Sometimes what is written directly contradicts what one knows about Oracle. In such cases, it may be a fun exercise to determine if what was written is correct (and why it is logically correct), or why it is wrong (and why it is logically incorrect). Take, for example, the “Top 5 Timed Events” seen in this book (no, I have not read this book, I bumped into it a couple times when performing Google searches):
http://books.google.com/books?id=bxHDtttb0ZAC&pg=PA17#v=onepage&q=&f=false
The text of the book states that the “Top 5 Timed Events” shown indicates a CPU Constrained Database (side note: if a database is a series of files stored physically on a disk, can it ever be CPU constrained?). From the “Top 5 Timed Events”, we see that there were 4,851 waits on the CPU for a total time of 4,042 seconds, and this represented 55.76% of the wait time. Someone reading the book might be left thinking one of:
* “That obviously means that the CPU is overwhelmed!”
* “Wow 4,851 wait events on the CPU, that sure is a lot!”
* “Wow wait events on the CPU, I didn’t know that was possible?”
* “Hey, something is wrong with this ‘Top 5 Timed Events’ output as Oracle never reports the number of waits on CPU.”
* “Something is really wrong with this ‘Top 5 Timed Events’ output as we do not know the number of CPUs in the server (what if there are 32 CPUs), the time range of the statics, and why the average time for a single block read is more than a second!”
A Google search then might take place to determine if anyone else reports the number of waits for the CPU in an Oracle instance:
http://www.google.com/search?num=100&q=Event+Waits+Time+CPU+time+4%2C851+4%2C042
So, it must be correct… or is it? What does the documentation show?
Another page from the same book:
http://books.google.com/books?id=bxHDtttb0ZAC&pg=PA28#v=onepage&q=&f=false
Shows the command:
alter system set optimizer_index_cost_adj=20 scope = pfile;Someone reading the book might be left thinking one of:
* That looks like an easy to implement solution.
* I thought that it was only possible to alter parameters in the spfile with an ALTER SYSTEM command, neat.
* That command will never execute, and should return an “ORA-00922: missing or invalid option” error.
* Why would the author suggest a value of 20 for OPTIMIZER_INDEX_COST_ADJ and not 1, 5, 10, 12, 50, or 100? Are there any side effects? Why isn’t the author recommending the use of system (CPU) statistics to correct the cost of full table scans?
A Google search finds this book (I have not read this book either, just bumped into it during a search) by a different author which also shows that it is possible to alter the pfile through an ALTER SYSTEM command:
http://books.google.com/books?id=ufz5-hXw2_UC&pg=PA158#v=onepage&q=&f=false
So, it must be correct… or is it? What does the documentation show?
Regarding the question of updating my knowledge, I read a lot of books on a wide range of subjects including Oracle, programming, Windows and Linux administration, ERP systems, Microsoft Exchange, telephone systems, etc. I also try to follow Oracle blogs and answer questions in this and other forums (there are a lot of very smart people out there contributing to forums, and I feel fortunate to learn from those people). As long as the book or blog offers logical reasoning, it is fairly easy to tie new material into one’s pre-existing knowledge.
Charles Hooper
IT Manager/Oracle DBA
K&M Machine-Fabricating, Inc.

Similar Messages

  • How to find block size in OS

    I know db_block_size and db_file_multiblock_read_count of Oracle should be multiple of OS(operationg System).
    Can anybody suggest me , how can i find out block size in window or Linux.
    Thanks in advance
    Tinku

    $show parameter db_block_size this is the setting from your init.ora file.
    This parameter is set at the database creation time and cannot be altered.
    In linux system use
    dumpe2fs -fh /dev/hdb
    to get information about your block size.
    In my case it was 4k so my db_block_size will be multiples of 4k.
    http://www.dizwell.com/html/db_block_size.html
    Thanks
    Gopal
    visit
    http://dba.shilpatech.com/

  • How to find Tuple(row) size in a Data Block

    hi,
    I want to find out the size of 1 row and total size of a table in a data block in Oracle 11g. For Example I've a Employee table with 300 rows. I want to find out how much space these rows are occupying in a data block (8192 default) and also the size of 1 individual row.
    I'll appreciate the valuable suggestions.
    Thanks alot.
    Regards,
    Kamran

    Hi,
    Welcome to the forum!
    See [Calculating Oracle average row length|http://www.dba-oracle.com/t_average_row_length.htm], I hope it helps
    Regards,

  • OS Block Size finding command

    Hi,
    can anybody tell me the command to find the OS block size?
    (DB block size should be multiple of OS block size).
    PS: i use Red Hat Linux OS. (would be fantastic if you give Sun OS command too)
    Regards
    Suresh

    df -g or fstyp -v
    Nicolas.

  • How to find block size of my OS

    Hi I am using redhat 9, I would like to know how to find out my OS block size as I need to give the database block size accordingly...

    I would rather adjust the OS block size to required database block size, not vice versa if possible.
    You can check the FILESYSTEM block size using dumpe2fs command (replace /dev/sda5 with your filesystem blocks device):
    [root@localhost ~]# dumpe2fs /dev/sda5 | grep "Block size"
    dumpe2fs 1.39 (29-May-2006)
    Block size: 4096
    If you want to know what's the minimum OS block device IO block size (which is not the same thing as filesystem block size), you can do it easily using an Oracle command (if your db is in archivelog mode):
    select block_size from v$archived_log where rownum = 1;
    Tanel.
    http://blog.tanelpoder.com

  • Database Block Size Smaller Than Operating System Block Size

    Finding that your database block size should be in multiples of your operating system block size is easy...
    But what if the reverse of the image below were the case?
    What happens when you store an Oracle Data Block that is 2 KB in an 8 KB Operating System Block?  Does it waste 6 KB or are there 4 Oracle Data Blocks stored in 1 Operating System Block?
    Is it different if you use ASM?
    I'd like to introduce a 2 KB block size into a RAC Exadata environment for a small set of highly transactional tables and indexes to reduce contention on blocks being requested in the Global Cache.  I've witnessed horrendous wait times for a plethora of sessions when a block was highly active.
    One index in particular has a column that indicates the "state" of the record, it is a very dense index.  Records will flood in, and then multiple processes will poll, do work, and change the state of the record.  The record eventually reaches a final state and is never updated again.
    I know that I can fill up the block with fluff by adjusting the percent free, percent used, and initrans, but that seems like a lazy hack to me and I'd like to do it right if possible.
    Any thoughts or wisdom is much appreciated.
    "The database requests data in multiples of data blocks, not operating system blocks."
    "In contrast, an Oracle block is a logical storage structure whose size and structure are not known to the operating system."
    http://docs.oracle.com/cd/E11882_01/server.112/e25789/logical.htm#BABDCGIB

    But what if the reverse of the image below were the case?
    What happens when you store an Oracle Data Block that is 2 KB in an 8 KB Operating System Block?  Does it waste 6 KB or are there 4 Oracle Data Blocks stored in 1 Operating System Block?
    Is it different if you use ASM?
    I'd like to introduce a 2 KB block size into a RAC Exadata environment for a small set of highly transactional tables and indexes to reduce contention on blocks being requested in the Global Cache.  I've witnessed horrendous wait times for a plethora of sessions when a block was highly active.
    One index in particular has a column that indicates the "state" of the record, it is a very dense index.  Records will flood in, and then multiple processes will poll, do work, and change the state of the record.  The record eventually reaches a final state and is never updated again.
    I know that I can fill up the block with fluff by adjusting the percent free, percent used, and initrans, but that seems like a lazy hack to me and I'd like to do it right if possible.
    Any thoughts or wisdom is much appreciated.
    "The database requests data in multiples of data blocks, not operating system blocks."
    "In contrast, an Oracle block is a logical storage structure whose size and structure are not known to the operating system."
    http://docs.oracle.com/cd/E11882_01/server.112/e25789/logical.htm#BABDCGIB
    You could have answered your own questions if you had just read the top of the page in that doc you posted the link for
    >
    At the finest level of granularity, Oracle Database stores data in data blocks. One logical data block corresponds to a specific number of bytes of physical disk space, for example, 2 KB. Data blocks are the smallest units of storage that Oracle Database can use or allocate.
    An extent is a set of logically contiguous data blocks allocated for storing a specific type of information. In Figure 12-2, the 24 KB extent has 12 data blocks, while the 72 KB extent has 36 data blocks.
    >
    There isn't any 'wasted' space using 2KB Oracle blocks for 8KB OS blocks. As the doc says Oracle allocates 'extents' and an extent, depending on your space management, is going to be a substantial multiple of blocks. You might typically have extents that are multiples of 64 KB and that would be 8 OS blocks for your example. Yes - it is possible that the very first OS block and the very last block might not map exactly to the Oracle blocks  but for a table of any size that is unlikely to be much of an issue.
    The single-block reads used for some index accesses could affect performance since the read of a 2K Oracle block will result in an 8K OS block being read but that 8K block is also likely to be part of the same index.
    The thing is though that an index entry that is 'hot' is going to be hot whether the block it is in is 2K or 8K so any 'contention' for that entry will exist regardless of the block size.
    You will need to conduct tests using a 2K (or other) block and cache size for your index tablespaces and see which gives you the best results for your access patterns.
    You should use the standard block size for ALL tablespaces unless you can substantiate the need for a non-standard size. Indexes and LOB storage are indeed the primary use cases for uses non-standard block sizes for one or more tablespaces. Don't forget that you need to allocate the appropriate buffer cache.

  • Need to understand the relation B/w Bigger block size like 16k or 32k

    Hi
    How can we determine which block size is good for the data base specially for reporting DB on which real time replication is being performed.
    I will really appreciate if some one could help me in identifying this or are there any ways to find out the correct DB block size by queering any db objects.

    I think that part of the decision will have to be based on knowledge of your application and how it interacts with the database. If you database does a lot of single reads/updates of records then the smaller block size will probably be more appropriate.
    However if your application does bulk reads, insertions then you might benefit for larger block sizes.
    There are several Thread already on this subject and references as well:
    size of db_block_size
    how to decide size of db_block_size of a block.
    Re: DB_BLOCK_SIZE
    do a search in the search field on the main thread page for more.
    Regards
    tim

  • Tablespaces and block size in Data Warehouse

    We are preparing to implement Data Warehouse on Oracle 11g R2 and currently I am trying to set up some storage strategy - unfortunately I have very little experience with that. The question is what are general advices in such considerations according table spaces and block size? I made some research and it is hard to find some clear answer, there are resources advising that block size is not important and can be left small (8 KB), others state that it is crucial and should be the biggest possible (64KB). The other thing is what part of data should be placed where? Many resources state that keeping indexes apart from its data is a myth and a bad practice as it may lead to decrease of performance, others say that although there is no performance benefit, index table spaces do not need to be backed up and thats why it should be split. The next idea is to have separate table spaces for big tables, small tables, tables accessed frequently and infrequently. How should I organize partitions in terms of table spaces? Is it a good idea to have "old" data (read only) partitions on separate table spaces?
    Any help highly appreciated and thank you in advance.

    Wojtus-J wrote:
    We are preparing to implement Data Warehouse on Oracle 11g R2 and currently I am trying to set up some storage strategy - unfortunately I have very little experience with that. With little experience, the key feature is to avoid big mistakes - don't try to get too clever.
    The question is what are general advices in such considerations according table spaces and block size? If you need to ask about block sizes, use the default (i.e. 8KB).
    I made some research and it is hard to find some clear answer, But if you get contradictory advice from this forum, how would you decide which bits to follow ?
    A couple of sensible guidelines when researching on the internet - look for material that is datestamped with recent dates (last couple of years), or references recent - or at least relevant - versions of Oracle. Give preference to material that explains WHY an idea might be relevant, give greater preference to material that DEMONSTRATES why an idea might be relevant. Check that any explanations and demonstrations are relevant to your planned setup.
    The other thing is what part of data should be placed where? Many resources state that keeping indexes apart from its data is a myth and a bad practice as it may lead to decrease of performance, others say that although there is no performance benefit, index table spaces do not need to be backed up and thats why it should be split. The next idea is to have separate table spaces for big tables, small tables, tables accessed frequently and infrequently. How should I organize partitions in terms of table spaces? Is it a good idea to have "old" data (read only) partitions on separate table spaces?
    It is often convenient, and sometimes very important, to separate data into different tablespaces based on some aspect of functionality. The performance thing was mooted (badly) in an era when discs were small and (disk) partitions were hard; but all your other examples of why to split are potentially valid for administrative. Big/Small, table/index, old/new, read-only/read-write, fact/dimension etc.
    For data warehouses a fairly common practice is to identify some sort of aging pattern for the data, and try to pick a boundary that allows you to partition data so that a large fraction of the data can eventually be made read-only: using tablespaces to mark time-boundaries can be a great convenience - note that the tablespace boundary need not match the partition boudary - e.g. daily partitions in a monthly tablespace. If you take this type of approach, you might have a "working" tablespace for recent data, and then copy the older data to "time-specific" tablespace, packing it and making it readonly as you do so.
    Tablespaces are (broadly speaking) about strategy, not performance. (Temporary tablespaces / tablespace groups are probably the exception to this thought.)
    Regards
    Jonathan Lewis

  • Mirrored RAID:  MediaKit reports block size error

    I am trying to create a 2nd set up backup drives for my photos.  I have two new iomega 2TB drives, which look essentially identical to drives I'm currently using as my primary backups as a mirrored RAID set.
    I can start the process with freshly erased and reformatted drives (with the default mac format, extended, journaled, unencrypted, not case-sensitive).  And after a minute or three, I see
    "MediaKit reports block size error, usually caused by not being a multiple of 512."
    The RAID options are Mirrored RAID, Mac extended journaled, and options settings are default.
    I see several series of posts with complaints about encrypting RAIDs and disk block sizes, but not unencrypted errors.   I actually started out trying to do this with the 2006 MBP running 10.6.8 and got a different error:  "POSIX reports:  the operation couldn't be completed. Operation not permitted."  I wasn't sure whether the 2TB RAID I already have was set up iwth the older or newer computer--it was definitely before I put Lion on this one--so I tried this one and now have a different error.
    Any idea what the problem might be? 

    Update:  I spent some time on the phone with an Apple support RAID expert, and couldn't figure out what the error was; we couldn't bypass it by playing with partitions on the drives, or any of another couple of manuevers that I've already forgotten.  He noted that his own searches were showing a lot of mentions of similar problems but only with Iomega drives, and he was finding the same links I found earlier about problems creating encrypted drives.  Now trying to decide if it's worth throwing more good money after bad for a call with Iomega support, and waiting to see if the iomega forum is at all helpful.

  • How to know the OS block size ?

    Hi all
    I want to know how to get the OS block size of my server ?
    For example if my server is Windows 2000 Professionnal , how can I get the size of my OS block size ?
    Thank you

    One way to find is to right click the drive in Windows Explorer and click Format (Not actually formatting it).
    In the popup window, you would see the "Allocation unit size" for the selected drive. Click "Close" to exit when done.

  • What USB storage devices have a block size of 512 bytes?

    After pulling my hair out for weeks trying to get a usb hard drive to work with my new AirPort Extreme (802.11n), I ran across this
    http://docs.info.apple.com/article.html?artnum=305038
    AirPort Extreme (802.11n): USB storage device supported formats and protocols
    You can connect USB-based storage devices to an AirPort Extreme (802.11n). Learn which formats and protocols are supported.
    The AirPort Extreme (802.11n) supports USB storage devices that have a block size of 512 bytes, and are formatted as Mac OS Extended (HFS-plus), FAT16, or FAT32. Not all USB storage devices use a block size of 512 bytes.
    The AirPort Extreme (802.11n) shares storage devices based on the format used to initialize the storage device. For example, if HFS-plus formatting was used, AFP and SMB/CIFS protocols are used to share the device on the network. If FAT16 or FAT32 was used, SMB/CIFS protocols are used.
    The AirPort Extreme (802.11n) works with disks that have a single partition and are not software RAID volumes (no more than one volume per physical disk). If the disk is a self-contained RAID that presents itself to a computer as a single volume requiring no software support, then it is supported.
    Note: Use AirPort Disk Utility to discover and mount AirPort Extreme-based volumes over the network.
    Now, this information is not easily obtainable while
    shopping for a new usb hard drive. How do I find out which
    ones support this 512 byte block size????
    Would have bee nice to know that not all usb hard drives
    are supported by the AirPort Extreme (802.11n) before I
    purchased it.
    Thanks
    J Riley

    Duane posted a link to an unofficial 802.11n Airport Extreme Hard Drive Compatibility List.
    http://www.ifelix.co.uk/tech/8014.html
    Still not enough information to make an informed purchase that
    will work.

  • Recommended Block Size For RAID 0

    I am setting up a RAID configuration (Striping, no Parity, Mac G5, OS-X) and was curious what the recommended Block Size should be. Content is primarily (but not limited to) Images created with Adobe Photoshop CS2 and range in size from 1.5MB to >20MB. The default for OS-X is 32K chunks of data.
    Drives are External FW-400.
    Many thanks, and Happy Holidays to all!

    If it is just scratch, run some benchmarks with it set to 128k and 256k and see how it feels with each. The default is too small, though some find it acceptable for small images. For larger files you want larger - and for PS scratch you definitely want 128 or 256k.

  • Buffer pool keep and multiple db block sizes

    I have a tablespace with 8k block size (database default) and a tablespace with 16k block size. I have db_cache_size and db_16k_cache_size set (obviously).
    Also i have buffer cache keep set in the database.
    Question: If a table is placed in a tablespace with 16k block size, and it's buffer pool is keep, does it end up in the keep pool (like tables from 8k tablsepace and keep pool set), or it ends in 16k buffer?

    You can find in the following online manual
    http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14220/memory.htm#i16408

  • Default block size for UFS format in OSX?

    Hi,
    I formatted an external drive as "unix format" (UFS) using Disk Utility, which subsequently became unrecognizable by the firewire controller. Now in a Unix box, the superblock of this drive is coming up as corrupted or nonexistent. Does anyone know where I can find the default block size for UFS in os x? I need to specify a backup superblock. Thanks!
    -Dan

    If it is just scratch, run some benchmarks with it set to 128k and 256k and see how it feels with each. The default is too small, though some find it acceptable for small images. For larger files you want larger - and for PS scratch you definitely want 128 or 256k.

  • RSA key and block size

    Let's say that I have an RSA key pair that has been generated in a keystore using the keytool utility.
    I am now accessing this key pair through some java code (using the Keystore class) and I want to encrypt/decrypt data using this public/private key.
    In order to encrypt/decrypt arbitray length data, I need to know the maximum block size that I can encrypt/decrypt.
    Based upon my experiment, this block size seems to be the size of the key divided by 8 and minus 11.
    But how can I determine all that programatically when the only thing that I have is the keystore?
    I did not find a way to figure out the size of the key from the keystore (unless it can be computed from the RSA exponent or modulus, but this is where my knowledged of RSA keys stops) and I did not find a way to figure out where this "magic" number 11 is coming from.
    I can always encrypt 1 byte of data and look at the size of the result. This will give me the blocksize and the key size by multiplying it by 8. But it means that I always need the public key around to compute this size (I cannot do it if I have only the private key).
    And this is not helping much on the number 11 side.
    Am I missing something obvious?
    Thanks.

    It is probably a bug. A naive implementation of RSA key generation that would exhibit this bug would work as follows (I'm ignoring the encrypt and decrypt exponents intentionally):
    input: an rsa modulus bit size k, k is even:
    output: the rsa modulus n.
    k is even, so let k=2*l
    step1: generate an l bit prime p, 2^l(-1) < p < 2^l
    step2: generate another l bit prime q, 2^l(-1) < q < 2^l
    step3: output n = p*q
    Now the above might seem reasonable, but when you multiply the inequalities you get
    2^(2*l -2) < n < 2^(2l)
    That lower bound means that n can be 1 bit smaller than you expect.. The correct smallest lower bound for generating the primes p and q is (2^l) / sqrt(2), rounded up to the nearest integer.
    I'll bet the IBM code implements something like the first algorithm.

Maybe you are looking for

  • Zipped files created with Java won't unzip with Java

    Hello there, I have written a class for unzipping a zip file using the 'ZipFile' class. It works perfectly fine when I extract zip files that have been created with XP, Winzip, or Winrar. I am now experimenting with creating zip files using the ZipOu

  • Purchase Order Message Determination  - RVCOMFZZ

    I'm using RVCOMFZZ to fill a specific client field added to structure KOMB and KOMKBEA. I need to acess the ekpo info of the purchase order about to be created. My COM_EKPO table is empty. Is this a bug or it's not possible to acess PO item data when

  • Error : 'The Connection can not be used to perform thsi operation

    Dear All, I am getting an error like 'The Connection can not be used to perform thsi operation, it is either close or Invalid in this context. Below is the code what am using: Sub Select_Query() Dim SQL_String As String Dim rs As ADODB.Recordset 'Thi

  • Delivery  with quantity major of the transfer order

    Dear All, I have a transfer order with quantity 30 units and I have executed two deliveries with transaction VL10B, the first with quantity 30 and the second with quantity 10, It is possible?

  • BPC 7.5 Installation Guide - Clarification Needed on UJA_SVR_DEFAULT

    Page 23, Section 3.4 Item number 10 of the BPC 7.5 NetWeaver Installation Guide says to do the following: 2. Go to transaction SE38 and run program UJA3_WRITE_SYS_USERS. This updates the settings in table UJA_SVR_DEFAULT with the Planning and Consoli