1. 程式人生 > >Oracle刪庫跑路

Oracle刪庫跑路

ont rest plus byte 停止 裝載 其中 global remove

--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刪庫跑路