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 want to delete an oracle instance (oracle 10.2.0.4.0) created in the AIX 6.0 OS. I know i can delete all the dbf and ctl files in the Terminal but i thinks that's no the best way to do it. I think must be a cleaner way to do that.

Thanks in advance.

share|improve this question

2 Answers 2

up vote 3 down vote accepted

You can delete databases with DBCA which takes care of most of it.

Or you can do as below, but this will do the same as removing the datafiles, redo logs, controlfiles manually.

sqlplus / as sysdba
startup mount exclusive restrict
exit
rman target /
drop database including backups noprompt;
exit

After this, you still have to remove the entry that belongs to the database from /etc/oratab, remove init.ora/spfile, password file from $ORACLE_HOME/dbs, and clean log directories (adump, bdump, cdump, udump).

share|improve this answer

If you decide to use DBCA to delete the database, you can do this:

If you want to completely remove an Oracle 10.2g instance from an Oracle home directory you first need to identify the instance in the oratab file. For example, this entry shows that the testdb Oracle database instance is associated with the following ORACLE_HOME:

testdb:/u01/app/oracle/product/11.2.0/db_1:Y
mydb:/u01/app/oracle/product/10.2.0/db_1:N

Next, you need to set the environment for the database that you want to remove, for example:

/usr/local/bin/oraenv
ORACLE_SID = [testdb] ? mydb

Now you can start the Database Configuration Assistant (DBCA):

dbca

Then, select the Database to delete (mydb) and click finish.

Removing an Oracle database deletes all of the data in the database. For example, among other things, this action will delete:

1) All files resulting from this query (for mydb):

SELECT name FROM v$datafile
   UNION
SELECT name FROM v$controlfile
   UNION
SELECT name FROM v$tempfile
   UNION
SELECT member FROM v$logfile

2) Entry associated with mydb in oratab

3) Entries associated with mydb in listener.ora and tnsnames.ora

You can also delete a database using DBCA in silent mode. For example, for single instance database:

dbca -silent -deleteDatabase -sourceDB <Oracle_Sid>

If you want to keep this data, make sure that you back up the database before deleting it.

Starting with Oracle Database 11g Release 2 (11.2), you can take advantage of the deinstall command.

share|improve this answer

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.