How to drop oracle database without DBCA

To drop,remove or delete entire 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. 



Drop 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.


SQL> shut immediate

Database closed.

Database dismounted.

ORACLE instance shut down.


Startup database in mount mode.


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 session or 'startup mount exclusive restrict;'


SQL>alter system enable restricted session;

or

SQL>startup mount exclusive restrict;


System altered.


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



No comments:

Post a Comment

Thanks for reading till end. I hope this will help you more to improve your knowledge.

Now it's your turn!

What do you think? Share your experience in the comments box and subscribe for more interesting post.