Dropping Tablespaces

To remove a tablespace from the data dictionary and therefore from the database, you need to drop that tablespace. In Oracle 9i, you can also drop the data file associated with the tablespace by specifying the AND DATAFILES clause:

DROP TABLESPACE mydb1data INCLUDING CONTENTS AND DATAFILES;

The following list provides all the possible parameters to the DROP TABLESPACE command along with the meanings of those parameters:

DROP TABLESPACE tablespacename
INCLUDING CONTENTS AND 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 ...

Get Oracle 9i Fundamentals I Exam Cram™ 2 (Exam 1Z0-031) now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.