Home > Ask the Oracle Database / Applications Experts > Oracle database design and architecture Questions & Answers > More on defragmenting a tablespace to free space
Ask The Oracle Expert: Questions & Answers
EMAIL THIS

More on defragmenting a tablespace to free space

Brian Peasland EXPERT RESPONSE FROM: Brian Peasland

Pose a Question
Other Oracle Categories
Meet all Oracle Experts
Become an Expert for this site


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


>
QUESTION POSED ON: 18 February 2003

Did I miss something? The question below regards tablespace free space. You state that prior to 8i, free space is dictionary-managed. I have an 8.0.5 instance, and I manage the tablespace free space. Often extents are created and the tablespace becomes fragmented. Creating and dropping indexes also fragements the tablespace. I use the command:

 ALTER TABLESPACE <tablespace name> 
 COALESCE;
This does not always pull the free space together, but most of the time it does. When it does not I may have to export all objects in a tablespace, coalesce the free space, then import the objects back into the tablespace. This works on pre 8i instances.

The question posed to you by another reader:

I have a tablespace consisting of four data files. Each data file is 1 GB. Overall, the tablespace has around 1.5 GB of data free. But the maximum contiguous free space available is only 50 MB. Can I defragment a tablespace to solve this issue? If yes what is the command?
This question posed on 07 February 2003


>

I'm a little unclear what your question is. You haven't missed anything except for the newer features of Oracle that make items like the ALTER TABLESPACE COALESCE command obsolete for today's Oracle DBA. This command will only defragment contiguous chunks of free space. It will not move any objects around, and it will not defragment objects. Additionally, if the default value for PCTINCREASE is a non-zero value for this tablespace, SMON will automatically coalesce free space for that tablespace, in effect issuing the above command for you.

If you read my answer again, and using your own comments, you will notice that "This does not always pull the free space together but, most of the time it does." Your solution was to export/import the objects to fix this problem. My solution is to use Oracle's new Locally Managed Tablespaces with uniform extents sizes. This way, you don't have to periodically issue the ALTER TABLESPACE COALESCE command, and you don't have to worry about ever having chunks of free space too small to use. Granted, my solution isn't easier in the short term, but I believe it to be a better solution in the long term.

For More Information


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Oracle database design and architecture
Why am I receiving Oracle memory allocation errors?
How to join two tables with unique keys in Oracle
How does the Oracle LGWR write to online redo log files?
Can I check an Oracle instance without logging into the Oracle server?
How to use V$SEGMENT_STATISTICS to find the most accessed Oracle table
Can I install an Oracle client on Windows 7?
How to use the Oracle Database Upgrade Assistant (DBUA)
Can I specify Oracle column order in my database table?
Can I have a single Oracle 11g RAC instance across multiple databases?
How to use the Oracle export utility to duplicate database structure

Oracle database design and architecture
Why am I receiving Oracle memory allocation errors?
How to join two tables with unique keys in Oracle
Can I check an Oracle instance without logging into the Oracle server?
How does the Oracle LGWR write to online redo log files?
How to determine your SQL database through needs analysis
Breaking down the contenders in the SQL database market
The MySQL open source database in the enterprise
Diving deeper into the SQL database features
What managers should consider when starting a database scaling project
How to use V$SEGMENT_STATISTICS to find the most accessed Oracle table

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
E. F. Codd  (SearchOracle.com)
extent  (SearchOracle.com)
flexfield  (SearchOracle.com)
foreign key  (SearchOracle.com)
multidimensional database  (SearchOracle.com)
object-oriented database management system  (SearchOracle.com)
quad tree  (SearchOracle.com)
relational online analytical processing  (SearchOracle.com)
row  (SearchOracle.com)
splay tree  (SearchOracle.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Oracle White Papers: Fusion Middleware
HomeNewsTopicsTipsAsk the ExpertsMultimediaWhite PapersProductsBlogs
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2003 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts