(1)備份數據庫之後,停止數據庫,使用dbca刪除數據庫
(2)移除diskgroup
進入節點2:export ORACLE_SID=+ASM2
sqlplus/ as sysdba
Alter diskgroup dgdata dismount;
進入節點1:export ORACLE_SID=+ASM1
先將數據文件刪除,否則drop的時候會報錯
asmcmd
rm –rf *
sqlplus / as sysdba
drop diskgroup dgdata;
(3)停止crs,並且使crs開機不自啟動,兩個節點分別用root用戶執行
./crsctldisable crs
./crsctlstop crs
(4)導出ocr盤和vote盤數據,做備份./ocrconfig–export /oracle/product/ocr.exp
dd if=/dev/raw/raw3 of=/oracle/product/vote1.exp
dd if=/dev/raw/raw4 of=/oracle/product/vote2.exp
dd if=/dev/raw/raw5 of=/oracle/product/vote3.exp
(5)注釋掉/etc/rc.local中格式化裸設備及給裸設備賦予權限的腳本。此時有很多oracle的進程運行,重啟服務器,因為crs開機啟動disabled了,重啟之後,oracle進程就不會運行了
(6)進入系統,移除共享盤。例如lvremove/dev/DATA/lv_ocr1,…. vgremove DATA, pvremove /dev/mapper/mpath
(7)存儲器中刪掉LUN
pvcreate
vgcreate DATA /dev/mapper/
lvcreate
(2)修改rc.local配置裸設備的腳本,並且重啟服務
(3)向raw1 raw2中加載ocr數據:
[root@ts01 bin]# ./ocrconfig -restore /oracle/product/ocr.exp
導入之後,驗證
[root@ts01 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 1023728
Used space (kbytes) : 3860
Available space (kbytes) : 1019868
ID :2144682474
Device/File Name :/dev/raw/raw1
Device/Fileintegrity check succeeded
Device/File Name :/dev/raw/raw2
Device/Fileintegrity check succeeded
Cluster registry integrity check succeeded
(4)此時ocr注冊表正常,檢查votedisk位置[root@ts01 bin]# ./crsctl query css votedisk
0. 0 /dev/raw/raw3
1. 0 /dev/raw/raw4
2. 0 /dev/raw/raw5
(5)導入votedisk備份數據root@ts01 bin]#dd if=/oracle/product/vot1.exp of=/dev/raw/raw3
2048000+0records in
2048000+0records out
1048576000 bytes(1.0 GB) copied, 417.17 seconds, 2.5 MB/s
[root@ts01 bin]#dd if=/oracle/product/vot2.exp of=/dev/raw/raw4
2048000+0records in
2048000+0records out
1048576000 bytes(1.0 GB) copied, 421.286 seconds, 2.5 MB/s
[root@ts01 bin]#dd if=/oracle/product/vot3.exp of=/dev/raw/raw5
2048000+0records in
2048000+0records out
1048576000 bytes(1.0 GB) copied, 422.608 seconds, 2.5 MB/s
(6)兩個節點分別執行啟動crs,和設置開機允許啟動crs[root@ts01 bin]# ./crsctl enable crs
[root@ts01 bin]# ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
(7)幾分鐘之後查看各項服務crs_stat–t
(8)運行dbca建立數據庫
(9)ASM實例已經存在了,之前的diskgroup已經被刪除,重新配置新diskgroup即可。