Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 

 

 

Oracle data block segment allocation

Oracle Database Tips by Donald Burleson

Question: 

Internally, how does Oracle allocate new data blocks to individual tables?

Answer: 

When we insert a rows into a data block, Oracle has the choice of re-using a data block from the freelist or grabbing a "brand new" empty data block, extending the table into the tablespace and raising the high water mark (HWM), usually in chunks of five data blocks (as of Oracle8i).

When a table is truncated, coalesced or moved, we can see free data blocks above the high-water mark, but usually all data blocks inside a segment are below the HWM, with some logically full blocks (off the freelist) and the others available for rows.

There are two insert options "direct path insert" and the APPEND hint that effect the allocation of blocks to tables.

  • Direct path inserts - These are performed with blocks above the table high water mark (i.e. no use of table freelists).
     
  • Append - Append tells Oracle to extend the table and grab new, empty data blocks for the insert.


Locking during table inserts

The issue of parallel inserts has a serialization issue with Oracle's TM locks.  Mark Bobak has some excellent comments on TM locking during table DDL:

As to the TM enqueue, well, any DML or DDL will take a TM enqueue. This is to protect the object's data dictionary definition. Conventional DML will take a TM enqueue in shared mode.

DDL takes a TM enqueue in exclusive mode. So, a table that's undergoing DML cannot have DDL executed. (The exclusive mode required for DDL is not compatible with the shared mode
the DML session already holds.) However, other conventional DML will be able to proceed, cause a shared mode enqueue is compatible with the shared mode already held.

In this way, Oracle allows concurrent DML, while preventing DDL on tables undergoing DML. Now, the direct-path INSERT is a special case. A direct-path INSERT takes a TM enqueue in exclusive mode, the same as DDL does. This prevents all other DML from occurring.

Honestly, I don't know enough about the details of the mechanism to clearly explain why this is required. I would speculate it's because otherwise, it would be possible to have direct-path INSERT modifying the HWM, and then (if it were permitted) conventional DML could fill all the blocks on the freelists, causing that session to want to raise the HWM.

That would be a problem, cause you'd have two different sessions wanting to raise the HWM at the same time. So, seems to me, you either serialize on the TM enqueue, or, you'd serialize on ST enqueue. (ST=space management transaction enqueue).
 

If you like Oracle tuning, you may enjoy my new book "Oracle Tuning: The Definitive Reference", over 900 pages of BC's favorite tuning tips & scripts. 

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts.


 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.