Let’s first look at the delete database syntax for Oracle Database 12c:

$ dbca -deleteDatabase -help
Delete a database by specifying the following parameters:
        -deleteDatabase
                -sourceDB    <Database unique name for RAC Database and SID for Single Instance Database>
                [-sid    <local instance_name of source database>]
                [-sysDBAUserName     <user name  with SYSDBA privileges>
                 -sysDBAPassword     <password for sysDBAUserName user name>]
                [-emConfiguration <DBEXPRESS|CENTRAL|BOTH|NONE>]
                        [-omsHost     <Enterprise Manager central agent home>
                        -omsPort     <Enterprise Manager central agent port>
                        -emUser     <Host user name for EM backup job>
                        -emPassword     <Host user password for EM backup job>]]

To easily delete/drop a database, invoke dbca with the -deleteDatabase and sourceDB options. Make sure that you look the log file after to make sure that there were no oracle generated errors.

$ dbca -silent -deleteDatabase -sourceDB DBATOOLS -sysDBAUserName sys -sysDBAPassword xxx4DBA

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 "/apps/oracle/cfgtoollogs/dbca/DBATOOLS.log" for further details.

Comments are closed