Q
Problem solve Get help with specific problems with your technologies, process and projects.

Avoiding ORA-27038 when creating a tablespace in 8i

I want to create an SQL automation script for Oracle 8i that creates a TABLESPACE like this:

 DROP TABLESPACE COMMON
 CREATE TABLESPACE "COMMON" ....
 DATAFILE 'G:ORACLEORADATACOMMON.ora' 
 ...
How can I avoid ORA-27038: skgfrcre: file exists error? I need something like DROP INCLUDING CONTENTS AND DATAFILES in 9i.

First, issue the following to drop the tablespace and its contents:

DROP TABLESPACE INCLUDING CONTENTS;
Then, when you create the tablespace, use something similar to the following to overwrite the existing datafile:
CREATE TABLESPACE my_tablespace
DATAFILE '/somedir/somefile.dbf' SIZE 100M REUSE;
The REUSE clause indicates that it is permissable to overwrite the datafile.

For More Information


Dig Deeper on Oracle database design and architecture

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close