Oracle删库跑路

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle删库跑路相关的知识,希望对你有一定的参考价值。

--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

 

技术分享图片
1 --10g R2
2 startup mount exclusive restrict;
3 alter system enable restricted session;
4 drop database;
10g R2
技术分享图片
1 --11g
2 startup mount exclusive;
3 alter system enable restricted session;
4 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删库
技术分享图片
 1 --RAC 12.1.0.2.0删库跑路失败1
 2 startup mount exclusive;
 3 alter system enable restricted session;
 4 drop database;
 5 
 6 
 7 oracle@DB01:/home/oracle#sqlplus / as sysdba
 8 
 9 SQL*Plus: Release 12.1.0.2.0 Production on 星期四 8月 16 15:17:08 2018
10 
11 Copyright (c) 1982, 2014, Oracle.  All rights reserved.
12 
13 Connected to an idle instance.
14 
15 SQL> startup mount exclusive;
16 ORACLE instance started.
17 
18 Total System Global Area 1.5945E+11 bytes
19 Fixed Size                  7726760 bytes
20 Variable Size            5.7982E+10 bytes
21 Database Buffers         1.0039E+11 bytes
22 Redo Buffers             1066012672 bytes
23 Database mounted.
24 SQL>
25 SQL> alter system enable restricted session;
26 
27 System altered.
28 
29 SQL> drop database;
30 drop database
31 *
32 ERROR at line 1:
33 ORA-01586: 对于此操作, 数据库必须以 EXCLUSIVE 模式装载且不打开
34 
35 SQL> alter database close;
36 alter database close
37 *
38 ERROR at line 1:
39 ORA-01109: 数据库未打开
40 
41 SQL> drop database;
42 drop database
43 *
44 ERROR at line 1:
45 ORA-01586: 对于此操作, 数据库必须以 EXCLUSIVE 模式装载且不打开
46 
47 SQL> select open_mode from v$database;
48 
49 OPEN_MODE
50 --------------------
51 MOUNTED
RAC 12.1.0.2.0删库跑路失败1
技术分享图片
 1 --RAC 12.1.0.2.0删库跑路失败2
 2 startup mount;
 3 alter system enable restricted session;
 4 drop database;
 5 
 6 SQL> startup mount;
 7 ORACLE instance started.
 8 
 9 Total System Global Area 1.5945E+11 bytes
10 Fixed Size                  7726760 bytes
11 Variable Size            5.7982E+10 bytes
12 Database Buffers         1.0039E+11 bytes
13 Redo Buffers             1066012672 bytes
14 Database mounted.
15 SQL> alter system enable restricted session;
16 
17 System altered.
18 
19 SQL> drop database;
20 drop database
21 *
22 ERROR at line 1:
23 ORA-01586: 对于此操作, 数据库必须以 EXCLUSIVE 模式装载且不打开
RAC 12.1.0.2.0删库跑路失败2

 

以上是关于Oracle删库跑路的主要内容,如果未能解决你的问题,请参考以下文章

程序员离职当天 “删库跑路”,被判刑 10 个月。。这事千万别干...

痛心,京东程序员删库跑路获刑!

P5270 无论怎样神树大人都会删库跑路

代码投毒删库跑路,开源生态链安全该如何保证?

程序员离职当天 “删库跑路”,被判刑 10 个月。。这事千万别干...

删库跑路计划图鉴