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 TRUNCATE tips

Oracle Database Tips by Donald Burleson

Oracle TRUNCATE statement allows you to quickly delete all rows of a table or cluster.

In release 11.2 truncate has been enhanced to allow you to remove all of the segment space consumed by a table on disk.  This was, you can truncate a table and remove all space associated with the table, shrinking the space until the table begins accepting rows again.

WARNING: The Oracle TRUNCATE statement is a DLL command and cannot be rolled back.

The Oracle docs note the syntax for the Oracle TRUNCATE statement as follows:

TRUNCATE 
   { TABLE [ schema. ]table
     [ { PRESERVE | PURGE } MATERIALIZED VIEW LOG ]
   | CLUSTER [ schema. ]cluster
   }
   [ { DROP | REUSE } STORAGE ]

The Oracle TRUNCATE statement is faster than the DELETE command because it is a DDL command and generates no rollback data. When using Oracle TRUNCATE on a clustered table, the data must be removed from the entire cluster, not just the one table. Any referential integrity constraints on a table must be disabled before it can be truncated. Like a table DROP, a truncation is not recoverable. If a table is truncated, you cannot roll back if you made a mistake. Use Oracle TRUNCATE carefully.

 The database does not actually delete any rows with the Oracle TRUNCATE statement, but with the Oracle TRUNCATE resets the table definition to an empty table by resetting the high water mark. Because of the nature of the Oracle TRUNCATE statement, the database has no way to actually retrieve the old rows.  As the truncated table begins to grow, the space where the old rows were written will be overwritten with the new rows.

 


 

   

 

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