Home > Ask the Oracle Database / Applications Experts > Questions & Answers > Will tablespace show more free space after deleting records?
Ask The Oracle Expert: Questions & Answers
EMAIL THIS

Will tablespace show more free space after deleting records?

Karen Morton EXPERT RESPONSE FROM: Karen Morton

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: 10 June 2003
I have a tablespace of 100 MB. Current usage is that 70 MB has 6 Lakh records. Now if I delete 4 lakh records, will the tablespace show more free space? My experience is that the size never changes even if data is deleted. Why is it so? No one has yet anwsered this question, even Mr. Tom Kyte of Oracle. I am hopeful of an anwser from you.


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



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


Actually Tom has answered this question several times on his site. You can find the following answer at http://asktom.oracle.com/pls/ask/f?p=4950:8:267180628148108421::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1336002638218,

When an extent is allocated to a table (or index, etc) it belongs to that table until you either drop or truncate the table.

When you delete the data from the table -- the blocks will go onto the freelist for that table (assuming the amount of space on a block that was freed fell below the pctused). These blocks will be used for subsequent inserts and updates into this table.

When you delete data from the index -- if the block the index entry was on is now "empty" -- that block will go back onto the freelist to be used anywhere in the index struct. Else that block stays where it is and data that would naturally go onto that block (because of where it is in the b*tree) will go there.

Space is effectively reused when you delete. Your database will not show any new free space in dba_free_space -- it will have more blocks on freelists and more empty holes in index structures.

So....the answer is that once space is allocated it will never again show up as "free space" unless the storage is deallocated (using drop or truncate). That's why you don't see any difference.

For More Information




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