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: Coalesce vs.  deallocate unused space

Oracle Database Tips by Donald Burleson

 

Question:  What is the difference between coalesce and "deallocate unused space"?

 

Answer:  Both the coalesce and "deallocate unused space" commands serve to free-up space, but they do it in different ways:

 

Deallocate unused space

 

Oracle notes that the "deallocate unused space" clause is used to to explicitly deallocate unused space at "the end" of a segment and makes that space available for other segments within the tablespace. 

 

alter table xxx deallocate unused space;

alter index xxx deallocate unused space;

 

Internally, Oracle deallocates unused space beginning from the end of the objects (allocated space) and moving downwards toward the beginning of the object, continuing down until it reaches the high water mark (HWM).  The high-water mark for the table determines the amount of data that is stored in the table.  For indexes, "deallocate unused space" coalesces all leaf blocks within same branch of b-tree, and quickly frees up index leaf blocks for use.

 

The coalesce statement

 

Unlike the "deallocate unused space" syntax, which removes space above the high-water mark, "coalesce" puts together discontiguous fragmented extents.

 

There are two type of space fragmentation in Oracle.  First is the honeycomb fragmentation, when the free extents are side by side, and the "Swiss Cheese" fragmentation, when the extents are separated by live segments.

 

alter table xxx coalesce;

alter index xxx coalesce;

 

The coalesce partition syntax

 

For partitioned tables, Oracle provides the "Coalesce partition" syntax.

 

alter table xxx
modify partition yyy
coalesce subpartition;

alter table xxx
modify partition yyy
coalesce partition;

 

The Oracle docs note that the coalesce partition syntax behave differently, depending on the type of partition:

"When a hash partition is coalesced, its contents are redistributed into one or more remaining partitions determined by the hash function.

 

The specific partition that is coalesced is selected by the database, and is dropped after its contents have been redistributed."


 

 

��  
 
 
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.