Efficently Removing Table Data in Oracle

Efficiently Removing Table Data

TRUNCATE statement to remove all data from a table:

SQL> truncate table emp;

If you don’t want the TRUNCATE statement to de-allocate the currently allocated extents, then use the REUSE STORAGE clause:

SQL> truncate table emp reuse storage;

TRUNCATE statement is often used when working with partitioned tables.

alter table f_sales truncate partition p_2012;


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.