Oracle删库跑路

时间:2022-07-24 23:45:55
--10g R2
startup mount exclusive restrict;
alter system enable restricted session;
drop database; --11g
startup mount exclusive;
alter system enable restricted session;
drop database; --RAC 12.1.0.2.0删库
1.先停止所有节点实例
2.在其中一节点操作,先关闭rac模式
startup nomount;
alter system set CLUSTER_DATABASE=FALSE scope=spfile;
shutdown immediate;
3.启动mount restric模式
startup mount restrict;
4.删除数据库
drop database;

删库删全套儿!

su - oracle
--删除service
srvctl remove service -d sgsopen -s sopen1
srvctl remove service -d sgsopen -s sopen2 --删除db库
1.先停止所有节点实例
2.在其中一节点操作,先关闭rac模式
startup nomount;
alter system set CLUSTER_DATABASE=FALSE scope=spfile;
shutdown immediate;
3.启动mount restric模式
startup mount restrict;
4.删除数据库
drop database; --删除db资源
srvctl remove database -d sgsopen
 --10g R2
startup mount exclusive restrict;
alter system enable restricted session;
drop database;

10g R2

 --11g
startup mount exclusive;
alter system enable restricted session;
drop database;

11g

--RAC 12.1.0.2.0删库
1.先停止所有节点实例
2.在其中一节点操作,先关闭rac模式
startup nomount;
alter system set CLUSTER_DATABASE=FALSE scope=spfile;
shutdown immediate;
3.启动mount restric模式
startup mount restrict;
4.删除数据库
drop database;

RAC 12.1.0.2.0删库

 --RAC 12.1.0.2.0删库跑路失败1
startup mount exclusive;
alter system enable restricted session;
drop database; oracle@DB01:/home/oracle#sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on 星期四 8月 16 15:17:08 2018 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to an idle instance. SQL> startup mount exclusive;
ORACLE instance started. Total System Global Area 1.5945E+11 bytes
Fixed Size 7726760 bytes
Variable Size 5.7982E+10 bytes
Database Buffers 1.0039E+11 bytes
Redo Buffers 1066012672 bytes
Database mounted.
SQL>
SQL> alter system enable restricted session; System altered. SQL> drop database;
drop database
*
ERROR at line 1:
ORA-01586: 对于此操作, 数据库必须以 EXCLUSIVE 模式装载且不打开 SQL> alter database close;
alter database close
*
ERROR at line 1:
ORA-01109: 数据库未打开 SQL> drop database;
drop database
*
ERROR at line 1:
ORA-01586: 对于此操作, 数据库必须以 EXCLUSIVE 模式装载且不打开 SQL> select open_mode from v$database; OPEN_MODE
--------------------
MOUNTED

RAC 12.1.0.2.0删库跑路失败1

 --RAC 12.1.0.2.0删库跑路失败2
startup mount;
alter system enable restricted session;
drop database; SQL> startup mount;
ORACLE instance started. Total System Global Area 1.5945E+11 bytes
Fixed Size 7726760 bytes
Variable Size 5.7982E+10 bytes
Database Buffers 1.0039E+11 bytes
Redo Buffers 1066012672 bytes
Database mounted.
SQL> alter system enable restricted session; System altered. SQL> drop database;
drop database
*
ERROR at line 1:
ORA-01586: 对于此操作, 数据库必须以 EXCLUSIVE 模式装载且不打开

RAC 12.1.0.2.0删库跑路失败2