IT Community - Software Programming, Web Development and Technical Support

How to drop a datafile from a tablespace

This is a discussion on How to drop a datafile from a tablespace within the Database Support forums, part of the Web Development category; Determining how many datafiles make up a tablespace To determine how many and which datafiles make up a tablespace, you ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > Database Support

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 11-03-2007, 01:29 AM
bluesky bluesky is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 201
bluesky is on a distinguished road
Default How to drop a datafile from a tablespace

Determining how many datafiles make up a tablespace
To determine how many and which datafiles make up a tablespace, you can use the following query:

SELECT
file_name
, tablespace_name
FROM
dba_data_files
WHERE
tablespace_name ='<name of tablespace>';
Scenario 1
If the datafile you wish to remove is the only datafile in that tablespace, you can simply drop the entire tablespace using the following:

DROP TABLESPACE <tablespace name> INCLUDING CONTENTS;

Scenario 2

If you have more than one datafile in the tablespace, and you do not need the information contained in that tablespace, or if you can easily recreate the information in this tablespace, then use the same command as above:

DROP TABLESPACE <tablespace name> INCLUDING CONTENTS;

Scenario 3


If you have more than one datafile in the tablespace and you wish to keep the objects that reside in the other datafile(s) which are part of this tablespace, then you must export all the objects inside the tablespace. Gather information on the current datafiles within the tablespace by running the following query in SQL*Plus:

SELECT
file_name
, tablespace_name
FROM
dba_data_files
WHERE
tablespace_name ='<name of tablespace>';
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Drop view statement. Pvinothkumar Database Support 5 03-25-2008 09:27 PM
Taffic Drop vadivelanvaidyanathan Search Engine Optimization 0 01-23-2008 06:29 AM
JavaScript Drag and Drop rajkumar HTML, CSS and Javascript Coding Techniques 6 12-31-2007 01:43 AM
TableSpace - SQL Server Murali Database Support 2 07-25-2007 05:29 AM
Drop shadow effect using css muthukumar HTML, CSS and Javascript Coding Techniques 0 07-17-2007 12:43 PM


All times are GMT -7. The time now is 03:38 AM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0