感谢Lunar的指导,完成ORACLE 12C RAC hub和leaf相互转换,参考官方文档Oracle Flex Clusters部分
当前数据库状态
--集群状态 [root@rac1 ~]# crsctl status res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.DATA.dg ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.LISTENER.lsnr ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.SYSDB_NEW.dg ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.SYSDG.dg ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.net1.network ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.ons ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.proxy_advm ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac1 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac2 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac2 STABLE ora.MGMTLSNR 1 ONLINE ONLINE rac2 169.254.177.226 10.1 .1.104,STABLE ora.asm 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE rac2 STABLE ora.gns 1 ONLINE ONLINE rac2 STABLE ora.gns.vip 1 ONLINE ONLINE rac2 STABLE ora.mgmtdb 1 ONLINE ONLINE rac2 Open,STABLE ora.oc4j 1 ONLINE ONLINE rac2 STABLE ora.ora12c.db 1 ONLINE ONLINE rac1 Open,STABLE 2 ONLINE ONLINE rac2 Open,STABLE ora.rac1.vip 1 ONLINE ONLINE rac1 STABLE ora.rac2.vip 1 ONLINE ONLINE rac2 STABLE ora.scan1.vip 1 ONLINE ONLINE rac1 STABLE ora.scan2.vip 1 ONLINE ONLINE rac2 STABLE ora.scan3.vip 1 ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- --rac运行在flex模式 [root@rac1 ~]# crsctl get cluster mode status Cluster is running in "flex" mode --asm运行在flex模式 [grid@rac1 ~]$ asmcmd ASMCMD> showclustermode ASM cluster : Flex mode enabled --节点角色 [root@rac1 ~]# crsctl get node role config Node 'rac1' configured role is 'hub' [root@rac2 ~]# crsctl get node role config Node 'rac2' configured role is 'hub'
转换hub to leaf
--转换hub为leaf [root@rac1 ~]# crsctl set node role leaf CRS-4408: Node 'rac1' configured role successfully changed; restart Oracle High Availability Services for new role to take effect. --关闭集群 [root@rac1 ~]# crsctl stop crs CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1' CRS-2673: Attempting to stop 'ora.crsd' on 'rac1' CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac1' CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac1' CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac1' CRS-2673: Attempting to stop 'ora.SYSDB_NEW.dg' on 'rac1' CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac1' CRS-2673: Attempting to stop 'ora.SYSDG.dg' on 'rac1' CRS-2673: Attempting to stop 'ora.ora12c.db' on 'rac1' CRS-2673: Attempting to stop 'ora.proxy_advm' on 'rac1' CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.rac1.vip' on 'rac1' CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.scan1.vip' on 'rac1' CRS-2677: Stop of 'ora.rac1.vip' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.rac1.vip' on 'rac2' CRS-2677: Stop of 'ora.ora12c.db' on 'rac1' succeeded CRS-2677: Stop of 'ora.scan1.vip' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.scan1.vip' on 'rac2' CRS-2676: Start of 'ora.rac1.vip' on 'rac2' succeeded CRS-2677: Stop of 'ora.SYSDB_NEW.dg' on 'rac1' succeeded CRS-2676: Start of 'ora.scan1.vip' on 'rac2' succeeded CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'rac2' CRS-2677: Stop of 'ora.DATA.dg' on 'rac1' succeeded CRS-2677: Stop of 'ora.SYSDG.dg' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.asm' on 'rac1' CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.ASMNET1LSNR_ASM.lsnr' on 'rac1' CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'rac2' succeeded CRS-2677: Stop of 'ora.proxy_advm' on 'rac1' succeeded CRS-2677: Stop of 'ora.ASMNET1LSNR_ASM.lsnr' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.ons' on 'rac1' CRS-2677: Stop of 'ora.ons' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.net1.network' on 'rac1' CRS-2677: Stop of 'ora.net1.network' on 'rac1' succeeded CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac1' has completed CRS-2677: Stop of 'ora.crsd' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.storage' on 'rac1' CRS-2673: Attempting to stop 'ora.crf' on 'rac1' CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1' CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1' CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac1' CRS-2677: Stop of 'ora.storage' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.asm' on 'rac1' CRS-2677: Stop of 'ora.drivers.acfs' on 'rac1' succeeded CRS-2677: Stop of 'ora.crf' on 'rac1' succeeded CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac1' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1' CRS-2673: Attempting to stop 'ora.evmd' on 'rac1' CRS-2677: Stop of 'ora.evmd' on 'rac1' succeeded CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'rac1' CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1' CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed CRS-4133: Oracle High Availability Services has been stopped. --启动集群 [root@rac1 ~]# crsctl start crs -wait CRS-4123: Starting Oracle High Availability Services-managed resources CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1' CRS-2672: Attempting to start 'ora.evmd' on 'rac1' CRS-2676: Start of 'ora.evmd' on 'rac1' succeeded CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1' CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.gipcd' on 'rac1' CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1' CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cssd' on 'rac1' CRS-2672: Attempting to start 'ora.diskmon' on 'rac1' CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded CRS-2789: Cannot stop resource 'ora.diskmon' as it is not running on server 'rac1' CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'rac1' CRS-2672: Attempting to start 'ora.ctssd' on 'rac1' CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'rac1' succeeded CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.storage' on 'rac1' CRS-2676: Start of 'ora.storage' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.crf' on 'rac1' CRS-2676: Start of 'ora.crf' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.crsd' on 'rac1' CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded CRS-6017: Processing resource auto-start for servers: rac1 CRS-6016: Resource auto-start has completed for server rac1 CRS-6024: Completed start of Oracle Cluster Ready Services-managed resources CRS-4123: Oracle High Availability Services has been started. --hub转换为leaf后状态 [root@rac1 ~]# crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr ONLINE ONLINE rac2 STABLE ora.DATA.dg ONLINE ONLINE rac2 STABLE ora.LISTENER.lsnr ONLINE ONLINE rac2 STABLE ora.SYSDB_NEW.dg ONLINE ONLINE rac2 STABLE ora.SYSDG.dg ONLINE ONLINE rac2 STABLE ora.net1.network ONLINE ONLINE rac2 STABLE ora.ons ONLINE ONLINE rac2 STABLE ora.proxy_advm ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac2 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac2 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac2 STABLE ora.MGMTLSNR 1 ONLINE ONLINE rac2 169.254.177.226 10.1 .1.104,STABLE ora.asm 1 ONLINE OFFLINE STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE rac2 STABLE ora.gns 1 ONLINE ONLINE rac2 STABLE ora.gns.vip 1 ONLINE ONLINE rac2 STABLE ora.mgmtdb 1 ONLINE ONLINE rac2 Open,STABLE ora.oc4j 1 ONLINE ONLINE rac2 STABLE ora.ora12c.db 1 ONLINE OFFLINE Instance Shutdown,ST ABLE 2 ONLINE ONLINE rac2 Open,STABLE ora.rac1.vip 1 ONLINE INTERMEDIATE rac2 FAILED OVER,STABLE ora.rac2.vip 1 ONLINE ONLINE rac2 STABLE ora.scan1.vip 1 ONLINE ONLINE rac2 STABLE ora.scan2.vip 1 ONLINE ONLINE rac2 STABLE ora.scan3.vip 1 ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- --集群角色 [root@rac1 ~]# crsctl get node role config Node 'rac1' configured role is 'leaf' [root@rac2 ~]# crsctl get node role config Node 'rac2' configured role is 'hub'
leaf转换为hub
--leaf转换为hub [root@rac1 ~]# crsctl set node role hub CRS-4408: Node 'rac1' configured role successfully changed; restart Oracle High Availability Services for new role to take effect. --关闭集群 [root@rac1 ~]# crsctl stop crs CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1' CRS-2673: Attempting to stop 'ora.crsd' on 'rac1' CRS-2677: Stop of 'ora.crsd' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.storage' on 'rac1' CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1' CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1' CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac1' CRS-2677: Stop of 'ora.storage' on 'rac1' succeeded CRS-2677: Stop of 'ora.drivers.acfs' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.crf' on 'rac1' CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1' CRS-2673: Attempting to stop 'ora.evmd' on 'rac1' CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac1' CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac1' succeeded CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded CRS-2677: Stop of 'ora.crf' on 'rac1' succeeded CRS-2677: Stop of 'ora.evmd' on 'rac1' succeeded CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.cssd' on 'rac1' CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1' CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed CRS-4133: Oracle High Availability Services has been stopped. --启动集群 [root@rac1 ~]# crsctl start crs -wait CRS-4123: Starting Oracle High Availability Services-managed resources CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1' CRS-2672: Attempting to start 'ora.evmd' on 'rac1' CRS-2676: Start of 'ora.evmd' on 'rac1' succeeded CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1' CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.gipcd' on 'rac1' CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1' CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cssd' on 'rac1' CRS-2672: Attempting to start 'ora.diskmon' on 'rac1' CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded CRS-2789: Cannot stop resource 'ora.diskmon' as it is not running on server 'rac1' CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'rac1' CRS-2672: Attempting to start 'ora.ctssd' on 'rac1' CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.asm' on 'rac1' CRS-2676: Start of 'ora.asm' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.storage' on 'rac1' CRS-2676: Start of 'ora.storage' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.crf' on 'rac1' CRS-2676: Start of 'ora.crf' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.crsd' on 'rac1' CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded CRS-6017: Processing resource auto-start for servers: rac1 CRS-2672: Attempting to start 'ora.ons' on 'rac1' CRS-2673: Attempting to stop 'ora.rac1.vip' on 'rac2' CRS-2672: Attempting to start 'ora.ASMNET1LSNR_ASM.lsnr' on 'rac1' CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac2' CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'rac2' succeeded CRS-2673: Attempting to stop 'ora.scan1.vip' on 'rac2' CRS-2677: Stop of 'ora.rac1.vip' on 'rac2' succeeded CRS-2672: Attempting to start 'ora.rac1.vip' on 'rac1' CRS-2677: Stop of 'ora.scan1.vip' on 'rac2' succeeded CRS-2672: Attempting to start 'ora.scan1.vip' on 'rac1' CRS-2676: Start of 'ora.rac1.vip' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.LISTENER.lsnr' on 'rac1' CRS-2676: Start of 'ora.scan1.vip' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'rac1' CRS-2676: Start of 'ora.ASMNET1LSNR_ASM.lsnr' on 'rac1' succeeded CRS-2676: Start of 'ora.ons' on 'rac1' succeeded CRS-2676: Start of 'ora.LISTENER.lsnr' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.asm' on 'rac1' CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'rac1' succeeded CRS-2676: Start of 'ora.asm' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.proxy_advm' on 'rac1' CRS-2676: Start of 'ora.proxy_advm' on 'rac1' succeeded CRS-2672: Attempting to start 'ora.ora12c.db' on 'rac1' CRS-2676: Start of 'ora.ora12c.db' on 'rac1' succeeded CRS-6016: Resource auto-start has completed for server rac1 CRS-6024: Completed start of Oracle Cluster Ready Services-managed resources CRS-4123: Oracle High Availability Services has been started. --集群状态 [root@rac1 ~]# crsctl stat res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.DATA.dg ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.LISTENER.lsnr ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.SYSDB_NEW.dg ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.SYSDG.dg ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.net1.network ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.ons ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE ora.proxy_advm ONLINE ONLINE rac1 STABLE ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE rac1 STABLE ora.LISTENER_SCAN2.lsnr 1 ONLINE ONLINE rac2 STABLE ora.LISTENER_SCAN3.lsnr 1 ONLINE ONLINE rac2 STABLE ora.MGMTLSNR 1 ONLINE ONLINE rac2 169.254.177.226 10.1 .1.104,STABLE ora.asm 1 ONLINE ONLINE rac1 STABLE 2 ONLINE ONLINE rac2 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE rac2 STABLE ora.gns 1 ONLINE ONLINE rac2 STABLE ora.gns.vip 1 ONLINE ONLINE rac2 STABLE ora.mgmtdb 1 ONLINE ONLINE rac2 Open,STABLE ora.oc4j 1 ONLINE ONLINE rac2 STABLE ora.ora12c.db 1 ONLINE ONLINE rac1 Open,STABLE 2 ONLINE ONLINE rac2 Open,STABLE ora.rac1.vip 1 ONLINE ONLINE rac1 STABLE ora.rac2.vip 1 ONLINE ONLINE rac2 STABLE ora.scan1.vip 1 ONLINE ONLINE rac1 STABLE ora.scan2.vip 1 ONLINE ONLINE rac2 STABLE ora.scan3.vip 1 ONLINE ONLINE rac2 STABLE -------------------------------------------------------------------------------- --集群角色 [root@rac1 ~]# crsctl get node role config Node 'rac1' configured role is 'hub' [root@rac2 ~]# crsctl get node role config Node 'rac2' configured role is 'hub'
这里实现了ORACLE 12C RAC的leaf和hub 角色相互转换,在转换的过程中需要转移确认集群和ASM均为flex mode,如果参考相关文档完成转换