如何(Deconfigure)解除配置/(Reconfigure)重新配置(重建 OCR)或卸载 GI (文档 ID 2016852.1)
文档内容
文档内容
用途
详细信息
A. Grid Infrastructure Cluster - 整个 Cluster
为什么需要解除配置?
重新配置的步骤
B. Grid Infrastructure Cluster - 单节点或者部分节点
解除配置和重新配置的步骤:
对于Windows平台,因为不存在root.sh,所以对于节点的添加删除请参考文档: note 1332451.1 - How to Add Node/Instance or Remove Node/Instance in Oracle Clusterware and RAC
C. Grid Infrastructure Standalone(Oracle Restart)
为什么需要解除配置?
解除配置的步骤
D. Grid Infrastructure 删除
参考
适用于:
Oracle Database - Enterprise Edition - 版本 11.2.0.1 到 12.1.0.2 [发行版 11.2 到 12.1]
本文档所含信息适用于所有平台
用途
这篇文档提供指导解除配置(Deconfigure)/重新配置(Reconfigure)或卸载 11gR2/12.2 GI。
注意:在12.1中,在执行过程中如果在相同的目录下面有rootcrs.sh, 应该使用rootcrs.sh而不是rootcrs.pl。
详细信息
在删除几点之前,先解除锁定
在解除配置一个节点之前,确保它不是被锁定的,即:
<GI_HOME>/bin/olsnodes -s -t
racnode1 Inactive Pinned
racnode2 Active Unpinned
racnode3 Active Unpinned
如果一个节点被锁定,首先解锁它,例如:作为 root 用户
A. Grid Infrastructure Cluster - 整个 Cluster
解除配置和重新配置整个群集将重建 OCR 和表决磁盘,用户资源(数据库,实例,服务,监听器等)都需要在重新配置后手动添加回集群。
为什么需要解除配置?
以下几种情况需要解除配置:
- OCR 损坏并且没有完整的备份
- 或者由于缺失 /etc or /var/opt/oracle 目录下的 oracle cluster 相关文件导致 GI 堆栈无法在任意一个节点启动,比如丢失 init.ohasd 等。如果是 GI 可以在最后一个可用节点启动,请参考下面章节"B. Grid Infrastructure Cluster - One or Partial Nodes"。
- $GRID_HOME 应该是完整的,因为 deconfigure 配置不会修复 $GRID_HOME 的损坏。
重新配置的步骤
重新配置之前,如果可能请使用 grid 用户收集以下信息,当重新配置完成后用于生成用户资源的列表来重新加入到集群中。
$GRID_HOME/bin/crsctl stat res -p
$GRID_HOME/bin/crsctl query css votedisk
$GRID_HOME/bin/ocrcheck
$GRID_HOME/bin/oifcfg getif
$GRID_HOME/bin/srvctl config nodeapps -a
$GRID_HOME/bin/srvctl config scan
$GRID_HOME/bin/srvctl config asm -a
$GRID_HOME/bin/srvctl config listener -l <listener-name> -a
$DB_HOME/bin/srvctl config database -d <dbname> -a
$DB_HOME/bin/srvctl config service -d <dbname> -s <service-name> -v
重新配置:
- 如果 OCR 和 Voting Disk 没有在 ASM 上面,或者 OCR 和 Voting Disk 在 ASM 上面但是没有用户数据在 OCR/Voting Disk ASM diskgroup:
在所有远程节点,使用 root 执行:
# <$GRID_HOME>/crs/install/rootcrs.pl -deconfig -force -verbose
一旦上面命令在所有节点执行完毕,在本地节点,使用 root 用户执行:
# <$GRID_HOME>/crs/install/rootcrs.pl -deconfig -force -verbose -lastnode
重新配置,运行 $GRID_HOME/crs/config/config.sh,可以参考文档 note 1354258.1:
- 如果 OCR 或 Voting Disks 在 ASM 并且有用户数据在 OCR/Voting Disk ASM diskgroup:
- 如果 GI 版本是 11.2.0.3 并且 bug 13058611 和 bug 13001955 被安装,或者 GI 版本是 11.2.0.3.2 GI PSU 或者更高:
在所有远程节点,使用 root 执行:
# <$GRID_HOME>/crs/install/rootcrs.pl -deconfig -force -verbose
一旦上面命令在所有节点执行完毕,在本地节点,使用 root 用户执行:
# <$GRID_HOME>/crs/install/rootcrs.pl -deconfig -force -verbose -keepdg -lastnode
为了重新配置,运行 $GRID_HOME/crs/config/config.sh,可以参考文档 note 1354258.1:
- 如果 bug 13058611 和 bug 13001955 没有被安装:
在所有节点,使用 root 用户执行:
# <$GRID_HOME>/crs/install/rootcrs.pl -deconfig -force -verbose
重新配置:
针对于 11.2.0.1 - 删除并且重新安装 OCR/Voting Disk 在一个新的 ASM 磁盘组或者 oracle 支持的集群/网络文件系统。
针对于 11.2.0.2 以及之前版本 - 运行 $GRID_HOME/crs/config/config.sh 并且安装 OCR/Voting Disk 到一个新的 ASM 磁盘组或者 oracle 支持的集群/网络文件系统。参考文档 note 1354258.1 中的详细解释关于config.sh/config.bat。
B. Grid Infrastructure Cluster - 单节点或者部分节点
这个过程仅适用于下面所有情况都满足:
- 一个或部分节点有问题,但是一个或其它节点可以正常运行-所以没有必要去解除配置整个集群。
- GI 是新安装的(没有升级)并且没有安装任何 patch set(interim patch 或者 patch set update(PSU))。
- 最初的设置之后,集群参数没有被更改过,比如说 OCR/Voting Disk 在相同的路径下,网络配置没有被修改等等。
- $GRID_HOME 应该是完整的,因为解除配置不会修复 $GRID_HOME 的损坏。
- 如果上面都不满足,需要使用删除/添加节点的办法解决: note 1332451.1 - How to Add Node/Instance or Remove Node/Instance in Oracle Clusterware and RAC
解除配置和重新配置的步骤:
使用 root 用户在问题节点执行:
# <$GRID_HOME>/crs/install/rootcrs.pl -deconfig -force
# <$GRID_HOME>/root.sh
对于Windows平台,因为不存在root.sh,所以对于节点的添加删除请参考文档: note 1332451.1 - How to Add Node/Instance or Remove Node/Instance in Oracle Clusterware and RAC
C. Grid Infrastructure Standalone(Oracle Restart)
为什么需要解除配置?
下面几种情况需要解除配置:
- OCR 损坏并且没有完整的备份
- 由于缺失 /etc or /var/opt/oracle 目录下的 oracle cluster 相关文件导致 GI 堆栈无法在任意一个节点启动,比如丢失 init.ohasd 等。$GRID_HOME 应该是完整的,因为解除配置不会修复 $GRID_HOME 的损坏。
- Nodename 需要被更改。
解除配置的步骤
解除配置之前,如果可能的话需要收集下面的信息:
$GRID_HOME/bin/crsctl stat res -p
$GRID_HOME/bin/srvctl config asm -a
$GRID_HOME/bin/srvctl config listener -l <listener-name> -a
$DB_HOME/bin/srvctl config database -d <dbname> -a
$DB_HOME/bin/srvctl config service -d <dbname> -s <service-name> -v
解除配置:
使用 root 用户执行:
# <$GRID_HOME>/crs/install/roothas.pl -deconfig -force -verbose
解除配置,参考文档 note 1422517.1。
D. Grid Infrastructure 删除
使用 grid 用户执行:
更多详细的信息,请参考官方文档中的以下章节:
Oracle Grid Infrastructure
Installation Guide
How to Modify or Deinstall Oracle Grid Infrastructure
如果有错误,解除配置失败的 GI 可以参考章节A-C的步骤,参考文档 note 1364419.1 来手动删除。
对于12.2:
如果有admin based数据库,首先需要卸载database home(通过database home的owner运行<db_home>/deinstall目录下面的deinstall工具),然后在移除grid home。 否则会报以下错误:
搜索关键字:recreate OCR,recreate Voting Disk,rebuild OCR
参考
NOTE:969254.1 - How to Proceed from Failed Upgrade to 11gR2 Grid Infrastructure on Linux/Unix
NOTE:1364419.1 - How to Deinstall Oracle Clusterware Home Manually
NOTE:399482.1 - Pre-11.2: How to Recreate OCR/Voting Disk Accidentally Deleted
NOTE:1069369.1 - How to Delete From or Add Resource to OCR in Oracle Clusterware
NOTE:1354258.1 - How to Configure or Re-configure Grid Infrastructure With config.sh/config.bat
浙公网安备 33010602011771号