代码改变世界

Oracle删库跑路

2018-08-16 17:17  WWJD_DBA  阅读(953)  评论(0编辑  收藏  举报
--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