How to drop oracle database without DBCA.

In this article, we will discuss How to drop oracle database while doing cloning, refreshing we need to follow the below steps to complete. Connect oracle database using sys user with sysdba and check whether database open in read write mode. 

 

How to drop oracle database
How to drop oracle database
 

How to drop oracle database.

Here we will check and ensure the right database to be deleted. Just source the environment file and login using sys as sysdba and check the name of the database. 

 
[oracle@abcapps trace]$ export ORACLE_SID=DEV

[oracle@abcapps trace]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Nov 2 09:51:16 2021

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

SQL> select name,open_mode from v$database;

 

NAME      OPEN_MODE

——— ——————–

DEV       READ WRITE

Shutdown database normally.

 

Shutdown:-

Now we will shutdown the database using command shut or shutdown immediate while there are several modes of shutting down oracle database like normal,immediate, transactional and abort.

Here we will use the shutdown immediate.

SQL> shut immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

 

Startup database in mount mode to drop oracle database.

 

SQL> startup mount;

ORACLE instance started.

 

Total System Global Area 1.6034E+10 bytes

Fixed Size                  2269072 bytes

Variable Size            2248147056 bytes

Database Buffers         1.3757E+10 bytes

Redo Buffers               26480640 bytes

Database mounted.

 

Enable Restricted mode:-

Enable restricted session or ‘startup mount exclusive restrict to your database to restrict the non sys login.

 

SQL>alter system enable restricted session;

or

SQL>startup mount exclusive restrict;

 

System altered.

 Manually Drop database.

Execute the drop database command to drop entire database with datafiles,control files and logfiles.

 

SQL> drop database;

 

Database dropped.

 

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 – 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

Now our database is dropped. We can start the restoration.

 You may also check the similar oracle article here.

 

Leave a Comment