Oracle 10 Gb new drop database Command

Source: Internet
Author: User
Before 10 Gb, there are only two methods to completely delete the database. One is to delete the database using the dbca graphical tool, and the other is to close the database, manually delete data files, control files, and log files.

Starting from 10 Gb, Oracle provides the drop database syntax, making database deletion very simple.

However, drop database still has certain restrictions:

SQL> Conn/As sysdba
Connected.
SQL> DROP DATABASE;
DROP DATABASE
*
Error at line 1:
ORA-01586: database must be mounted exclusive and not open for this operation

SQL> alter database close;

Database altered.

SQL> DROP DATABASE;
DROP DATABASE
*
Error at line 1:
ORA-12719: operation requires database is in restricted mode

SQL> alter system enable restricted session;

System altered.

SQL> DROP DATABASE;

Database dropped.

Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.3.0-64bit Production
With the partitioning, OLAP and Data Mining options
SQL> exit
[Oracle @ bjtest ~] $ PS-Ef | grep test102
Oracle 15805 14913 0 00:00:00 pts/1 grep test102

The database must be in the Mount state and the restricted session is set. After the drop database Command is executed, Oracle automatically deletes the control file, data files recorded in the control file, and online redo log files. If spfile is used in the database, the spfile file is also deleted. This command does not delete archive and backup files.

In the alert file, you can see the operation corresponding to the drop database:

drop database
mon May 18 06:13:01 2009
deleted file/data/Oracle Data/test102/system01.dbf
deleted file/data/oradata/test102/undotbs1.dbf
deleted file/data/oradata/test102/sysaux01.dbf
deleted file/data/oradata/test102/redo01.log
deleted file/data/oradata/test102/redo02.log
deleted file/data/oradata/test102/redo03.log
deleted file/data/oradata/test102/redo04.log
deleted file/data/oradata/test102/redo05.log
deleted file/data/oradata/test102/redo06.log
deleted file/data/oradata/test102/redo07.log
deleted file/data/oradata/test102/temp01.dbf
instance terminated by user, PID = 15795
deleted file/data/oradata/test102/control01.ctl
completed: drop database
mon May 18 06:13:08 2009
shutting down instance (abort)
license high water mark = 1

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.