11g RAC 環境:ASM 磁碟組被誤刪,導致 OCR(Oracle Cluster Registry)與所有備份遺失,OLR(Oracle Local Registry)亦損壞。無備份可用,唯有重建集群註冊資訊。
位於 $GRID_HOME/crs/install/rootcrs.pl,需 root 執行。關鍵參數:
-deconfig:移除 Clusterware 配置,支援重裝/重建。-force:強制執行不可驗證步驟(生產環境慎用)。-keepdg:保留現有磁碟組(本案例不適用,磁碟組已丟失)。-deinstall:重置 CRS Home 權限。[root@rac-two install]# ./rootcrs.pl -deconfig -force
Using configuration parameter file: ./crsconfig_params
Network exists: 1/192.168.4.0/255.255.255.0/eth0
... (清除 OCR、OLR、GPnP profile、投票磁碟註冊等)
Successfully deconfigured Oracle Clusterware stack on this node.
[root@rac-one install]# ./rootcrs.pl -deconfig -force -lastnode
... (額外清除叢集級資源、ASM 配置、GNS 等)
Oracle Clusterware successfully deconfigured from all nodes.
./rootcrs.pl -init 初始化權限(可選)。./rootcrs.pl(無參數)進行全新配置,依提示輸入網路、儲存、GNS 等資訊。./rootcrs.pl 加入叢集。srvctl add ...)。crsctl check crs、ocrcheck、ocrconfig -showbackup 正常。ocrconfig -manualbackup。「最大的悲劇莫過於資料庫壞了備份沒了。」
ocrconfig -backuploc 指定非 ASM 共享檔案系統路徑作為第二備份地。rootcrs.pl -deconfig -force 重建流程,納入 Runbook。無備份重建 OCR/OLR 屬於最高等級災難恢復,操作風險極大,務必在測試環境完整演練後再投入生產。