Bigboss's Blog for Oracle DataBase

My Experiences with Oracle Database

Dropping Tablespaces

Posted by thakuranupam on November 8, 2009

The following list provides all the possible parameters to the DROP TABLESPACE command:

DROP TABLESPACE tablespacename
INCLUDING CONTENTS
[AND DATAFILES | INCLUDING DATAFILES]
CASCADE CONSTRAINTS;

  • INCLUDING CONTENTS - Causes all the segments in the tablespace to be dropped
  • AND DATAFILES (or INCLUDING DATAFILES) - Causes all the data files associated with the tablespace to be dropped from the operating system
  • CASCADE CONSTRAINTS - Causes all the referential integrity constraints from other tablespaces’ tables that refer to primary and unique keys on the tables in the dropped tablespace to be themselves dropped

A tablespace that still contains data cannot be dropped without specifying the INCLUDING CONTENTS option.

If AND DATAFILES parameter is not specified, only the pointers in the control files that reference the data files associated with the tablespace are dropped along with the associated data dictionary information. This means that the data files still exist and must be deleted explicitly with the appropriate operating system commands.

It is recommended to take offline any tablespace that is intended to drop, even read-only tablespaces, so that no transactions are accessing the segments in the tablespace when the drop command is issued.

Advertisement

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 )

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

 
Follow

Get every new post delivered to your Inbox.