Drop oracle 12c database
Oracle 12c is a multi tenant architecture Oracle 12c database is having the root container database and it includes a pluggable database. following are the different ways to drop the Oracle 12c database.
1. DBCA (Silent Method or GUI)
2. Command Line Interface (startup mount restrict and then issue drop database)
3. Manually cleaning up files
In this blog we are dropping the database by using the command line interface. below command will delete root container database as well as all pluggable database. make sure you have proper client approval and the backups before dropping the database.
STEP1. set the environment for the database. in this example we are dropping p r t e s t database.
[oracle@prim ~]$ . oraenv
ORACLE_SID = [pritst] ?
The Oracle base remains unchanged with value /data/oracle/app/oracle
[oracle@prim ~]$
[oracle@prim ~]$
STEP 2. if the database is up and running then shutdown the database.
[oracle@prim ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Thu Nov 22 16:05:46 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
STEP 3. start a database in mount stage with the restricted mode.
[oracle@prim ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Thu Nov 22 16:09:46 2018
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Connected to an idle instance.
SQL>
SQL>
SQL> startup mount exclusive restrict;
ORACLE instance started.
Total System Global Area 834666496 bytes
Fixed Size 2929888 bytes
Variable Size 608176928 bytes
Database Buffers 218103808 bytes
Redo Buffers 5455872 bytes
Database mounted.
STEP 4. drop the database.
SQL> drop database;
Database dropped.
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 – 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL>
Following video will give you the clear idea how to drop Oracle 12c database