Sometimes you may need to drop Oracle database especially in test or development databases.
Mostly test or development databases are expired when testing or development is done. And When these databases are not used, we should drop this database with following steps.
You cannot drop Oracle database when it is open. You will get following error if you try this.
[[email protected] ~]$ sqlplus / as sysdba SQL*Plus: Release 188.8.131.52.0 - Production on Tue Mar 26 07:13:04 2019 Version 184.108.40.206.0 Copyright (c) 1982, 2018, Oracle. All rights reserved. Connected to: Oracle Database 19c Enterprise Edition Release 220.127.116.11.0 - Production Version 18.104.22.168.0 SQL> drop database; drop database * ERROR at line 1: ORA-01586: database must be mounted EXCLUSIVE and not open for this operation
You should shutdown database and open it mount exclusive mode.
SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> SQL> SQL> startup mount restrict ORACLE instance started. Total System Global Area 1140849896 bytes Fixed Size 8895720 bytes Variable Size 838860800 bytes Database Buffers 285212672 bytes Redo Buffers 7880704 bytes Database mounted. SQL>
Then you can drop database like following.
SQL> drop database; Database dropped. Disconnected from Oracle Database 19c Enterprise Edition Release 22.214.171.124.0 - Production Version 126.96.36.199.0 SQL> SQL> exit [[email protected] ~]$
You can see that Oracle database 19c is dropped.
[[email protected] ~]$ sqlplus / as sysdba SQL*Plus: Release 188.8.131.52.0 - Production on Tue Mar 26 07:19:54 2019 Version 184.108.40.206.0 Copyright (c) 1982, 2018, Oracle. All rights reserved. Connected to an idle instance. SQL>
You can read the following post to learn How To Create A Database Manually and How to Create a Database Using DBCA Silent Mode in Oracle
Do you want to learn Oracle Database for Beginners, then read the following articles.
1,559 views last month, 2 views today