How to delete an RAC Database Using DBCA silent mode

Posted in: Technical Track

I was recently working on a Proof Of Concept to migrate RAC non-CDB to CDB. I faced multiple issues and wanted to start fresh. In order to do this, I needed to delete the newly RAC CDB database.

Review database process:

[oracle@racnode-dc2-1 ~]$ ps -ef|grep pmon
oracle 11786 1 0 16:04 ? 00:00:00 asm_pmon_+ASM1
oracle 13727 1 0 16:05 ? 00:00:00 mdb_pmon_-MGMTDB
oracle 18674 1 0 17:19 ? 00:00:00 ora_pmon_hawkcdb1
oracle 23810 25204 0 17:35 pts/0 00:00:00 grep --color=auto pmon

[oracle@racnode-dc2-1 ~]$ . /media/patch/hawkcdb.env
The Oracle base remains unchanged with value /u01/app/oracle
ORACLE_UNQNAME=hawkcdb
ORACLE_SID=hawkcdb1
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/12.2.0.1/db1
Oracle Instance alive for sid "hawkcdb1"

[oracle@racnode-dc2-1 ~]$ srvctl status database -d hawkcdb -v
Instance hawkcdb1 is running on node racnode-dc2-1. Instance status: Open.
Instance hawkcdb2 is running on node racnode-dc2-2. Instance status: Open.

Delete database using DBCA silent mode:

[oracle@racnode-dc2-1 ~]$ dbca -silent -deleteDatabase -sourceDB hawkcdb \
> -sysDBAUserName sys -sysDBAPassword Oracle_4U! \
> -forceArchiveLogDeletion

Connecting to database
9% complete
14% complete
19% complete
23% complete
28% complete
33% complete
38% complete
47% complete
Updating network configuration files
48% complete
52% complete
Deleting instances and datafiles
66% complete
80% complete
95% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/hawkcdb.log" for further details.

[oracle@racnode-dc2-1 ~]$ srvctl config database
hawk
[oracle@racnode-dc2-1 ~]$

Check process and ASM Disk Group.

[oracle@racnode-dc2-1 ~]$ ps -ef|grep pmon
oracle 11786 1 0 16:04 ? 00:00:00 asm_pmon_+ASM1
oracle 13727 1 0 16:05 ? 00:00:00 mdb_pmon_-MGMTDB
oracle 25636 25204 0 17:38 pts/0 00:00:00 grep --color=auto pmon

[oracle@racnode-dc2-1 ~]$ cat /etc/oratab
#Backup file is /u01/app/12.2.0.1/grid/srvm/admin/oratab.bak.racnode-dc2-1 line added by Agent
-MGMTDB:/u01/app/12.2.0.1/grid:N
hawk1:/u01/app/oracle/12.2.0.1/db1:N
hawkcdb1:/u01/app/oracle/12.2.0.1/db1:N
+ASM1:/u01/app/12.2.0.1/grid:N

[oracle@racnode-dc2-1 ~]$ . /media/patch/gi.env
The Oracle base remains unchanged with value /u01/app/oracle
ORACLE_SID=+ASM1
ORACLE_BASE=/u01/app/oracle
GRID_HOME=/u01/app/12.2.0.1/grid
ORACLE_HOME=/u01/app/12.2.0.1/grid
Oracle Instance alive for sid "+ASM1"

[oracle@racnode-dc2-1 ~]$ asmcmd ls DATA
hawk/
hawkcdb/

[oracle@racnode-dc2-1 ~]$ asmcmd ls DATA/*

+DATA/hawk/:
CONTROLFILE/
DATAFILE/
ONLINELOG/
PARAMETERFILE/
PASSWORD/
TEMPFILE/

+DATA/hawkcdb/:
[oracle@racnode-dc2-1 ~]$

In summary, DBCA silent is a quick and efficient method to delete a database when required.

email

Interested in working with Michael? Schedule a tech call.

No comments

Leave a Reply

Your email address will not be published. Required fields are marked *