Saturday, 1 July 2017

How to drop oracle database ?

Oracle database drop .. 



SQL> drop database;
drop database
*
ERROR at line 1:
ORA-01586: database must be mounted EXCLUSIVE and not open for this operation


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


SQL> startup mount exclusive restrict ;
ORACLE instance started.


Total System Global Area 1068937216 bytes
Fixed Size                  2260088 bytes
Variable Size             671089544 bytes
Database Buffers          390070272 bytes
Redo Buffers                5517312 bytes
Database mounted.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options


[oracle@oraasm12c dbs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sat Jul 1 19:03:25 2017

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, Automatic Storage Management, OLAP, Data Mining
and Real Application Testing options


SQL>  drop database;

Database dropped.



No file in ASM ...

ASMCMD [+DATA] > ls -s
Block_Size  Blocks  Bytes  Space  Name
                                  ASM/
                                  ORA12C/
                                  ORAWIN/
       512      15   7680      0  orapwasm => +DATA/ASM/PASSWORD/pwdasm.256.938381713
                                  vihaan/

2 comments:


  1. For RAC

    drop database;
    drop database
    *
    ERROR at line 1:
    ORA-01586: database must be mounted EXCLUSIVE and not open for this operation


    SYS@anuj1> alter system set cluster_database=FALSE scope=spfile;

    System altered.

    SYS@anuj1> Shutdown abort;
    ORACLE instance shut down.
    SYS@anuj1> startup mount exclusive restrict;
    ORACLE instance started.

    Total System Global Area 6413680640 bytes
    Fixed Size 2265224 bytes
    Variable Size 1392512888 bytes
    Database Buffers 4999610368 bytes
    Redo Buffers 19292160 bytes
    Database mounted.

    SYS@anuj1> Drop Database;

    ReplyDelete
  2. SQL> shutdown immediate ;
    Database closed.
    Database dismounted.
    ORACLE instance shut down.
    SQL> startup mount exclusive restrict ;
    ORACLE instance started.

    Total System Global Area 789172224 bytes
    Fixed Size 2257392 bytes
    Variable Size 515902992 bytes
    Database Buffers 268435456 bytes
    Redo Buffers 2576384 bytes
    Database mounted.
    SQL> drop database;

    Database dropped.

    Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
    With the Partitioning, Automatic Storage Management, OLAP, Data Mining
    and Real Application Testing options
    SQL>

    ReplyDelete