Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have two databases which were created using dbca. I made some changes in the second database, and I can't login to that database anymore, and, of course, I can't delete it by using dbca.

I am using Centos 5 and Oracle 10g Release 2.

How can I delete a database manually without impacting another dababase?

share|improve this question
add comment

migrated from stackoverflow.com Jun 7 '13 at 10:32

This question came from our site for professional and enthusiast programmers.

2 Answers

up vote 3 down vote accepted

From René Nyffenegger's blog:

Since 10g, It is possible to drop a database in Oracle 10g with the new SQL statement drop database

The command gets rid of datafiles online redo log files, controlfiles and spfile…

shutdown abort;
startup mount exclusive restrict; 
drop database;
exit

Requirements:

. database must be closed
. exclusively mounted
. restricted

If you do not have a password, you should still be able to connect from the console, eg:

sqlplus / as sysdba
share|improve this answer
add comment

If by database you mean tablespaces and schemas, and if your databases are based on different datafiles, you can remove tablespaces and datafiles like this:

DROP TABLESPACE tablespace_name
 INCLUDING CONTENTS AND DATAFILES 
   CASCADE CONSTRAINTS ;

If you want to delete entire database itself:

drop database database_name including backups

The secondary db will not be impacted unlesss you have cross references using database links, in which case some procedures or views will become invalid.

share|improve this answer
add comment

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.