centsos 6上启动和关闭oracle 11gR2 rac

本文档详细介绍了如何在CentOS 6上通过srvctl命令启动和关闭Oracle 11gR2 Real Application Clusters (RAC)。内容包括检查集群资源状态、关闭数据库、停止ASM实例、关闭CRS以及重新启动整个集群的步骤。关闭RAC时,由于OCR盘存储在ASM上,故不能直接关闭ASM,需要先停止CRS。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

使用srvctl 启动和关闭rac

centos 6中启动CRSCSSD等服务的文件,在/etc/init.d目录下

[root@csicn20db01 init.d]# ls -l init.ohasd

-rwxr-xr-x 1 root root 8782 May 10 13:30 init.ohasd

 

查看集群的状态

[grid@csicn20db01 ~]$ crsctl status res -t

--------------------------------------------------------------------------------

NAME           TARGET  STATE        SERVER                   STATE_DETAILS       

--------------------------------------------------------------------------------

Local Resources

--------------------------------------------------------------------------------

ora.CRS.dg

               ONLINE  ONLINE       csicn20db01                                  

               ONLINE  ONLINE       csicn20db02                                  

ora.DATA.dg

               ONLINE  ONLINE       csicn20db01                                  

               ONLINE  ONLINE       csicn20db02                                  

ora.LISTENER.lsnr

               ONLINE  ONLINE       csicn20db01                                  

               ONLINE  ONLINE       csicn20db02                                  

ora.asm

               ONLINE  ONLINE       csicn20db01              Started             

               ONLINE  ONLINE       csicn20db02              Started             

ora.gsd

               OFFLINE OFFLINE      csicn20db01                                  

               OFFLINE OFFLINE      csicn20db02                                  

ora.net1.network

               ONLINE  ONLINE       csicn20db01                                  

               ONLINE  ONLINE       csicn20db02                                  

ora.ons

               ONLINE  ONLINE       csicn20db01                                  

               ONLINE  ONLINE       csicn20db02                                  

ora.registry.acfs

               ONLINE  ONLINE       csicn20db01                                  

               ONLINE  ONLINE       csicn20db02                                  

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.LISTENER_SCAN1.lsnr

      1        ONLINE  ONLINE       csicn20db02                                  

ora.csicn20db01.vip

      1        ONLINE  ONLINE       csicn20db01                                  

ora.csicn20db02.vip

      1        ONLINE  ONLINE       csicn20db02                                  

ora.cvu

      1        OFFLINE OFFLINE                                                   

ora.mycim.db

      1        ONLINE  ONLINE       csicn20db01              Open                

      2        ONLINE  ONLINE       csicn20db02              Open                

ora.oc4j

      1        OFFLINE OFFLINE                                                   

ora.scan1.vip

      1        ONLINE  ONLINE       csicn20db02  

Note:正确关闭rac有助于理解rac各个资源的依赖关系

 

关闭rac

1:关闭数据库

[grid@csicn20db01 ~]$ srvctl stop database -d mycim

Notemycim为数据库

[grid@csicn20db01 ~]$ crsctl status res -t

可以看到数据库offline

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.LISTENER_SCAN1.lsnr

      1        ONLINE  ONLINE       csicn20db02                                  

ora.csicn20db01.vip

      1        ONLINE  ONLINE       csicn20db01                                  

ora.csicn20db02.vip

      1        ONLINE  ONLINE       csicn20db02                                  

ora.cvu

      1        OFFLINE OFFLINE                                                   

ora.mycim.db

      1        OFFLINE OFFLINE                               Instance Shutdown   

      2        OFFLINE OFFLINE                               Instance Shutdown

2:关闭节点的的asm实例

[grid@csicn20db01 ~]$ srvctl stop asm -n csicn20db01

[grid@csicn20db01 ~]$ srvctl stop asm -n csicn20db02

PRCR-1014 : Failed to stop resource ora.asm

PRCR-1065 : Failed to stop resource ora.asm

CRS-2529: Unable to act on 'ora.asm' because that would require stopping or relocating 'ora.CRS.dg', but the force option was not specified

Note:无法关闭asm,这是因为ocr盘存放在asm盘上,而crsd又是asmclient客户端,所以无法关闭asm,但是后面的提示说强制关闭的方式不受限制

解决方式:

关闭CRS(两个节点都需要执行)

[root@csicn20db01 bin]# ./crsctl stop crs

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'csicn20db01'

CRS-2673: Attempting to stop 'ora.crsd' on 'csicn20db01'

CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'csicn20db01'

CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'csicn20db01'

CRS-2673: Attempting to stop 'ora.CRS.dg' on 'csicn20db01'

CRS-2673: Attempting to stop 'ora.registry.acfs' on 'csicn20db01'

CRS-2673: Attempting to stop 'ora.DATA.dg' on 'csicn20db01'

CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'csicn20db01' succeeded

CRS-2673: Attempting to stop 'ora.csicn20db01.vip' on 'csicn20db01'

CRS-2677: Stop of 'ora.DATA.dg' on 'csicn20db01' succeeded

CRS-2677: Stop of 'ora.registry.acfs' on 'csicn20db01' succeeded

CRS-2677: Stop of 'ora.csicn20db01.vip' on 'csicn20db01' succeeded

CRS-2672: Attempting to start 'ora.csicn20db01.vip' on 'csicn20db02'

CRS-2676: Start of 'ora.csicn20db01.vip' on 'csicn20db02' succeeded

CRS-2677: Stop of 'ora.CRS.dg' on 'csicn20db01' succeeded

CRS-2673: Attempting to stop 'ora.asm' on 'csicn20db01'

CRS-2677: Stop of 'ora.asm' on 'csicn20db01' succeeded

CRS-2673: Attempting to stop 'ora.ons' on 'csicn20db01'

CRS-2677: Stop of 'ora.ons' on 'csicn20db01' succeeded

CRS-2673: Attempting to stop 'ora.net1.network' on 'csicn20db01'

CRS-2677: Stop of 'ora.net1.network' on 'csicn20db01' succeeded

CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'csicn20db01' has completed

CRS-2677: Stop of 'ora.crsd' on 'csicn20db01' succeeded

CRS-2673: Attempting to stop 'ora.ctssd' on 'csicn20db01'

CRS-2673: Attempting to stop 'ora.evmd' on 'csicn20db01'

CRS-2673: Attempting to stop 'ora.asm' on 'csicn20db01'

CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'csicn20db01'

CRS-2673: Attempting to stop 'ora.mdnsd' on 'csicn20db01'

CRS-2677: Stop of 'ora.evmd' on 'csicn20db01' succeeded

CRS-2677: Stop of 'ora.mdnsd' on 'csicn20db01' succeeded

CRS-2677: Stop of 'ora.asm' on 'csicn20db01' succeeded

CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'csicn20db01'

CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'csicn20db01' succeeded

CRS-2677: Stop of 'ora.ctssd' on 'csicn20db01' succeeded

CRS-2673: Attempting to stop 'ora.cssd' on 'csicn20db01'

CRS-2677: Stop of 'ora.drivers.acfs' on 'csicn20db01' succeeded

CRS-2677: Stop of 'ora.cssd' on 'csicn20db01' succeeded

CRS-2673: Attempting to stop 'ora.gipcd' on 'csicn20db01'

CRS-2677: Stop of 'ora.gipcd' on 'csicn20db01' succeeded

CRS-2673: Attempting to stop 'ora.gpnpd' on 'csicn20db01'

CRS-2677: Stop of 'ora.gpnpd' on 'csicn20db01' succeeded

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'csicn20db01' has completed

CRS-4133: Oracle High Availability Services has been stopped.

节点二也执行

[root@csicn20db02 bin]# ./crsctl stop crs

Note:可以看到关闭了所有的集群资源和asm实例

 

启动rac

启动CRS(两个节点都执行)

[root@csicn20db02 bin]# ./crsctl start crs

CRS-4123: Oracle High Availability Services has been started.

[grid@csicn20db01 ~]$ crsctl status res -t                                 

--------------------------------------------------------------------------------

Cluster Resources

--------------------------------------------------------------------------------

ora.LISTENER_SCAN1.lsnr

      1        ONLINE  ONLINE       csicn20db01                                  

ora.csicn20db01.vip

      1        ONLINE  ONLINE       csicn20db01                                  

ora.csicn20db02.vip

      1        ONLINE  ONLINE       csicn20db02                                  

ora.cvu

      1        OFFLINE OFFLINE                                                   

ora.mycim.db

      1        OFFLINE OFFLINE                               Instance Shutdown   

      2        OFFLINE OFFLINE                               Instance Shutdown   

ora.oc4j

      1        OFFLINE OFFLINE                                                   

ora.scan1.vip

      1        ONLINE  ONLINE       csicn20db01  

Note:根据资源状态没有启动数据库

启动数据库

[grid@csicn20db01 ~]$ srvctl start instance -d mycim -i mycim1 -o open

[grid@csicn20db01 ~]$ srvctl start instance -d mycim -i mycim2 -o open

查看资源状态

ora.mycim.db

      1        ONLINE  ONLINE       csicn20db01              Open                

      2        ONLINE  ONLINE       csicn20db02              Open

 

启动某一个instance

srvctl start nodeapps -n rac1

srvctl start asm -n rac1

srvctl start instance -d racdb -i racdb1 -o open

 

单独启动和关闭某一个资源

crsctl start ora.csicn20db01.vip

crsctl stop ora.csicn20db01.vip

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值