Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to recreate a tablespace in Oracle and get the following error message:

  "created file already exists"

I am running the following script:

create smallfile tablespace dev_01 datafile 'C:\Oradata\db1\devdata\dev_01
.dbf' size 500M

Any ideas? I have tried killing any sessions that were using the file.

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Oracle in Windows does not drop the datafile, despite the synax in the INCLUDING clause. You can manually delete it using Windows, or you can simply use:

CREATE SMALLFILE TABLESPACE dev_01 
       DATAFILE 'C:\Oradata\db1\devdata\dev_01.dbf' SIZE 500M REUSE;

This will reuse the existing file if it exists.

share|improve this answer

I've tried this command which complains that the tablespace does not exist:

DROP TABLESPACE dev_01 INCLUDING CONTENTS AND DATAFILES;
share|improve this answer
1  
That's because the tablespace has been dropped. However, the datafile does not get dropped in Oracle/Windows. –  DCookie Feb 1 '10 at 17:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.