drop database---ora-01586
drop database
*
ERROR at line 1:
ORA-01586: database must be mounted EXCLUSIVE and not open for this operation
SQL> select instance_name, status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
ANDREA OPEN
SQL> ! oerr ora 01586
01586, 00000, "database must be mounted EXCLUSIVE and not open for this operation"
// *Cause: Attempting to DROP DATABASE when the database is not mounted
// EXCLUSIVE.
// *Action: Mount the database in EXCLUSIVE mode.
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 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> exit
------------------------------------------------
DROP DATABASE
Purpose
Use the DROP DATABASE command to delete the target database and, if RMAN is connected to a recovery catalog, unregister it. RMAN removes all datafiles, online redo logs, and control files belonging to the target database. By default, RMAN prompts for confirmation.
Prerequisites
Execute this command only at the RMAN prompt. You must be connected to a target database. The target database must be mounted exclusive and not open, and started in RESTRICT mode.
Syntax
dropDatabase::=
Semantics
Syntax Element | Description |
---|---|
INCLUDING BACKUPS |
Deletes backup
sets, proxy copies, image copies, and archived redo logs associated
with the target database from all configured device types.
Note: If you have been using a recovery catalog but run RMAN in NOCATALOG mode when you drop the database, then RMAN will not delete any backups which are known to the recovery catalog but no longer exist in the target database control file. |
NOPROMPT | Does not prompt for confirmation before deleting the database. |
Example
Example 2-69 Deleting a Database
In this example, you want to delete a test database called test1 that is registered in the recovery catalog. You start the RMAN client, connect to database test1 as TARGET, and connect to the recovery catalog. You then run the following commands to delete the target database files, as well as all backups, copies, and archived logs associated with the database:
RMAN> CONNECT TARGET SYS@test1
target database Password: password connected to target database: TEST1 (DBID=39525561)
RMAN> STARTUP FORCE MOUNT
RMAN> SQL 'ALTER SYSTEM ENABLE RESTRICTED SESSION';
RMAN> DROP DATABASE INCLUDING BACKUPS NOPROMPT;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/21754115/viewspace-1063555/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- drop asm disk、撤銷drop asm diskASM
- Drop DatabaseDatabase
- JavaScript drop 事件JavaScript事件
- SQL__DROPSQL
- windows drop emWindows
- oracle drop columnsOracle
- mysql drop keyMySql
- alter database drop datafile 與 drop tablespace file 的區別Database
- Oracle中drop user和drop user cascade的區別Oracle
- drag &drop 拖拽事件事件
- drag & drop 拖拽事件事件
- drop materialized view hung !!!ZedView
- drop、delete 與truncatedelete
- KEEP INDEX | DROP INDEXIndex
- torch--drop out
- alter database datafile offline drop 與 alter tablespace drop datafile 區別Database
- Drag & Drop 拖拽詳解
- HTML5 : Drag & DropHTML
- mysql恢復drop表MySql
- 快速drop mysql大表MySql
- truncate delete drop 區別delete
- 【Flashback】使用Flashback Drop技術閃回被DROP表的指定版本資料
- Quality Inspection in drop shipment process
- 簡述truncate、delete和dropdelete
- flashback drop/query/table/database/archiveDatabaseHive
- Truncate,Delete,Drop的比較.delete
- How To Efficiently Drop A Table With Many Extents
- How to drop Oracle RAC database manually?OracleDatabase
- flashback技術之---flashback drop
- oracle 誤刪表 drop tableOracle
- tarui drop失效,解決配置UI
- drop apply INSTANTIATION for one tableAPP
- HTML5 Drag和Drop 拖拽HTML
- dnd.js 拖放庫 Drag and DropJS
- Lodash原始碼分析-drop.js原始碼JS
- Oracle Drop表(purge)恢復(ODU)Oracle
- maridb Error 'Operation DROP USER failed forErrorAI
- SQL truncate 、delete與drop區別SQLdelete