HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Deleting an Oracle database without connecting to it?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
deletingwithoutconnectingdatabaseoracle

Problem

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?

Solution

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

Code Snippets

shutdown abort;
startup mount exclusive restrict; 
drop database;
exit
sqlplus / as sysdba

Context

StackExchange Database Administrators Q#44035, answer score: 3

Revisions (0)

No revisions yet.