Oracle
  Home arrow Oracle arrow Page 4 - Developing and Implementing Applicatio...
Dev Shed Forums 
Administration  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Download TestComplete 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
IBM Developerworks
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ORACLE

Developing and Implementing Applications, continued
By: McGraw-Hill/Osborne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 4
    2006-02-16

    Table of Contents:
  • Developing and Implementing Applications, continued
  • Switching Consumer Groups
  • Editing Stored Outlines
  • The Golden Rule for Space Calculations
  • Sizing the Objects
  • Estimating Space Requirements for Indexes
  • Sizing Tables That Contain Large Objects (LOBs)
  • Using Object Views

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Developing and Implementing Applications, continued - The Golden Rule for Space Calculations
    (Page 4 of 8 )

    Keep your space calculations simple, generic, and consistent across databases. There are far more productive ways to spend your work time than performing extremely detailed space calculations that Oracle may ignore anyway. Even if you follow the most rigorous sizing calculations, you cannot be sure how Oracle will load the data into the table or index.

    In the following section, you’ll see how to simplify the space-estimation process, freeing you to perform much more useful DBA functions. These processes should be followed whether you are generating the default storage values for a dictionary managed tablespace or the extent sizes for locally managed tablespaces.

    NOTE

    In an Oracle 10g database, you should be using locally managed tablespaces. If you have upgraded from a prior release that used dictionary-managed tablespaces, you should replace them with locally managed tablespaces.

    The Ground Rules for Space Calculations

    Oracle follows a set of internal rules when allocating space:

    1. Oracle only allocates whole blocks, not parts of blocks.
    2. Oracle allocates sets of blocks rather than individual blocks.
    3. Oracle may allocate larger or smaller sets of blocks depending on the available free space in the tablespace.

    Your goal should be to work with Oracle’s space-allocation methods instead of against them. If you use consistent extent sizes, you can largely delegate the space allocation to Oracle even in a dictionary-managed tablespace.

    The Impact of Extent Size on Performance

    There is no direct performance benefit gained by reducing the number of extents in a table. In some situations (such as in Parallel Query environments), having multiple extents in a table can significantly reduce I/O contention and enhance your performance. Regardless of the number of extents in your tables, they need to be properly sized.

    Oracle reads data from tables in two ways: by RowID (usually immediately following an index access) and via full table scans. If the data is read via RowID, the number of extents in the table is not a factor in the read performance. Oracle will read each row from its physical location (as specified in the RowID) and retrieve the data.

    If the data is read via a full table scan, the size of your extents can impact performance to a very small degree. When reading data via a full table scan, Oracle will read multiple blocks at a time. The number of blocks read at a time is set via the DB_FILE_MULTIBLOCK_READ_COUNT database initialization parameter and is limited by the operating system’s I/O buffer size. For example, if your database block size is 8KB and your operating system’s I/O buffer size is 128KB, you can read up to 16 blocks per read during a full table scan. In that case, setting DB_FILE_ MULTIBLOCK_READ_COUNT to a value higher than 16 will not change the performance of the full table scans.

    Your extent sizes should take advantage of Oracle’s ability to perform multiblock reads during full table scans. For example, if your operating system’s I/O buffer is 128KB, your extent sizes should be a multiple of 128KB.

    Consider a table that has ten extents, each of which is 128KB in size. For this example, the operating system’s I/O buffer size is 128KB. To perform a full table scan, Oracle must perform ten reads (because 128KB is the operating system I/O buffer size). If the data is compressed into a single 1280KB extent, Oracle still must perform ten reads to scan the table. Compressing the extents results in no gain in performance.

    If the table’s extent size is not a multiple of the I/O buffer size, the number of reads required for full table scans may increase. For the same 1280KB table, you could create eight extents that are 160KB each. To read the first extent, Oracle will perform two reads: one for the first 128KB of the extent, and a second read for the last 32KB of the extent (reads cannot span extents). To read the whole table, Oracle must therefore perform two reads per extent, or 16 reads. Reducing the number of extents from ten to eight increases the number of reads by 60 percent.

    To avoid paying a performance penalty for your extent sizes, you must choose from one of the following strategies:

    1. Create extents that are significantly larger than your I/O size. If the extents are very large, very few additional reads will be necessary even if the extent size is not a multiple of the I/O buffer size.
    2. Set DB_FILE_MULTIBLOCK_READ_COUNT to take full advantage of the I/O buffer size for your operating system. Note that setting this too high may make the optimizer think that full table scans are more efficient than they actually are, resulting in changes to existing execution plans.
    3. If you must create small extents, choose extent sizes that are a multiple of the I/O buffer size for your operating system.

    If the I/O buffer size for your operating system is 128KB, your pool of extent sizes from which to choose are 128KB, 256KB, 512KB, 1MB, and so on. You can further reduce the pool of extent sizes from which to choose.

    Use a pool of extent sizes that meets the following criterion: Every extent size will hold an integral multiple of every smaller extent size. The simplest implementation of this rule is to create extent sizes that increase by doubling: 1MB, 2MB, 4MB, 16MB, 32MB. To reduce the number of extent sizes to manage, you can quadruple the values instead of doubling: 1MB, 4MB, 16MB, and so on. Use these values for your locally managed tablespaces or rely on their automatic extent-sizing feature.

    More Oracle Articles
    More By McGraw-Hill/Osborne


       · This article is an excerpt from the book "Oracle Database 10g DBA Handbook,"...
     

    Buy this book now. This article is excerpted from chapter five of the book Oracle Database 10g DBA Handbook, written by Kevin Loney and Bob Bryla (McGraw-Hill/Osborne, 2005; ISBN: 0072231459). Check it out today at your favorite bookstore. Buy this book now.

       

    ORACLE ARTICLES

    - Tuning PL/SQL Code
    - Debugging PL/SQL Code
    - Testing PL/SQL Code
    - Working With PL/SQL Code
    - Conditional Compilation for Oracle Database ...
    - Compile-Time Warnings for Oracle DB 10g
    - Compiling PL/SQL Code for an Oracle Database
    - Troubleshooting PL/SQL Code
    - Managing PL/SQL Code
    - Data Manipulation and More for HTML DB Appli...
    - Oracle Database Fundamentals
    - Adding Processes to HTML DB Applications
    - Adding Computations, Processes, and Validati...
    - Sub-templates and More with Oracle HTML DB
    - Focusing on Templates in Oracle HTML DB

     
    Accelerating Trading Partner Performance
     
    Competing on Analytics
     
    Cost Effective Scaling with Virtualization and Coyote Point Systems
     
    Five Checkpoints to Implementing IP Telephony
     
    Hosted Email Security: Staying Ahead of New Threats
     




    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway