Delete Database Using DBCA

We often want to remove a database and create it again or make a way for new database. DBA often do this task, for creating new DB for Development team. Here is a simple way to delete a database using dbca.

1.Create Response File
Add following lines in response file

RESPONSEFILE_VERSION="11.1.0"
OPERATION_TYPE="deleteDatabase"
[DELETEDATABASE]
SOURCEDB="DEV_DB"
SYSDBAUSERNAME="sys"
SYSDBAPASSWORD="welcome"

Let’s say we saved this file as /mylocation/deleteDB.rsp

Response file version is version of you Database.
Operation Type is ‘deleteDatabase’ since we want to delete o
Source DB is name of the database which we want to delete
Sys user name is required to delete database
And last the syspassword

2.Set ORACLE_HOME

setenv ORACLE_HOME u02/app/product/11.2.0/dbhome_1

3.Set ORACLE_SID

setenv ORACLE_SID DEV_DB

4.Run the dbca command

$ORACLE_HOME/bin/dbca -deleteDatabase -silent -responseFile /mylocation/deleteDB.rsp

Running the command will show following logs :

Connecting to database
4% complete
9% complete
14% complete
19% complete
23% complete
28% complete
47% complete
Updating network configuration files
52% complete
Deleting instance and datafiles
76% complete
100% complete
Look at the log file "/u02/app/cfgtoollogs/dbca/DEV_DB.log" for further details.

Notes:
This is tested with database 11.2.0.2
In case you dont want to keep password in response file, you can pass it on command line using -sysDBAPassword
E.g.

$ORACLE_HOME/bin/dbca -deleteDatabase -silent -responseFile /mylocation/deleteDB.rsp -sysDBAPassword mypassword

Oracle Single Instance Vs RAC Vs RAC One Node

Planning a new database installation for your Dev/Test/Prod environment ?

There are three types of deployment options you have :

  • Oracle Single Instance (SI)
  • Oracle Real Application Cluster (RAC)
  • Oracle RAC One Node

Let me give you a overview of these different views of databases :

Single Instance(SI)  : SI is a simple and basic option of deploying oracle database. In single instance database there is only one instance of database running on one node. SI is simple to install and maintain. This could be a good choice for small production and development environments.

Oracle RAC Database : Oracle RAC database is a clustered database. It can have more than one instance running on one or more hosts. To make is database RAC , there is another software needs to be installed called Oracle Grid infrastructure which takes care of multinode sync, ASM, Oracle restart etc. Oracle GI is necessary as a base of Oracle RAC. In Oracle RAC, the load is balanced across multiple instance of databases running on different nodes. This is best for Production database. Failure of any instance is abstracted from user and forwarded to another instance from the database server pool. No of instances can be controlled using Policy Managed or Admin Managed.

Oracle RAC One Node : Some time we need to have RAC databases but donot need many instances, why? Simple answers to it is leverage the high availability of RAC. The Oracle RAC One node is a RAC DB runs on one host. The advantage is it saves your resource, can to converted to full RAC any time, Cluster fail over i.e. the Database instance is moved to new instance in case of any failure on host known as Instance Relocation,easy to upgrade etc. This type of database is well suited for small production and dev/test environments.