• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Techgoeasy

Techgoeasy

Learn Oracle, PHP, HTML,CSS,Perl,UNIX shell scripts

  • Home
  • Oracle
    • Oracle database
    • Oracle Ebusiness Suite
    • Oracle weblogic
    • Oracle Performance Tuning
    • Oracle Hyperion
    • Oracle Cloud Tutorials
  • SQL
  • interview questions
  • Linux
  • PHP and HTML
  • Downloads
  • General
Home » Oracle » Oracle Database » How to drop the oracle database

How to drop the oracle database

October 2, 2021 by techgoeasy Leave a Comment

In this post, we will discuss how to drop the oracle database. The below procedure drops the spfile also but it does not touch Oracle Home. You may want to backup the spfile before dropping the database

sqlplus / as sysdba
startup mount (If database not started)
create pfile='/tmp/pfile.ora' from spfile;

How to drop the database

Now follow the below procedure to drop the database

  1. Source the environment
$. oraenv
[ORACLE_SID]? TEST
or
export ORACLE_SID=TEST
export ORACLE_HOME=<ORACLE_HOME PATH>

2- Connect as sysdba

$ sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Mon Dec 1 17:38:02 2014
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.


3- Start The database

SQL> startup
ORACLE instance started.
Total System Global Area 134045184 bytes
Fixed Size 2217952 bytes
Variable Size 142871862 bytes
Database Buffers 129317222 bytes
Redo Buffers 16343040 bytes
Database mounted.
Database opened.


4- Shutdown the database

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

5- Start in Exclusive mode

SQL> startup mount exclusive restrict
ORACLE instance started.
Total System Global Area 134045184 bytes
Fixed Size 2217952 bytes
Variable Size 142871862 bytes
Database Buffers 129317222 bytes
Redo Buffers 16343040 bytes
Database mounted.


6- Drop the database

SQL> drop database;
Database dropped.
Disconnected from Oracle Database 11g Enterprise Edition Release 12.2.0.1.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>

This completes dropping the database.

How to Drop the RAC database

If the Database is Oracle RAC, then the below steps need to be executed in mount state

alter system set cluster_database=FALSE scope=spfile

Then stop and mount in exclusive mode and drop it

Related Articles

Flashback PDB in Oracle Database 12c Release 2
PDB Relocate in Oracle database 12c Release 2
How to remotely clone a PDB or non-CDB in Oracle Database 12.1
Hot PDB cloning in Oracle database 12.2
Refreshable PDB in Oracle Database 12.2
https://docs.oracle.com/database/121/ADMIN/cdb_mon.htm#ADMIN13720

Filed Under: Oracle, Oracle Database

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar



Subscribe to our mailing list

Enter your email address to subscribe to this blog and receive notifications of new posts by email

Recent Posts

  • How to generate sql monitor report in Oracle
  • How to find the long running (longops session) in Oracle
  • How to find concurrent request id from Sid or spid
  • how to check recycle bin in oracle: Purge, enable/disable
  • how to check fra size in oracle: Location, usage, change size

Copyright © 2023 : TechGoEasy

  • Hire me
  • Privacy Policy
  • Contact Us
  • New? Start Here
  • About Us