Oracle11g RAC集群启动关闭管理

来源:互联网 发布:js 修改less 变量 编辑:程序博客网 时间:2024/05/16 09:01

简单的Oracle11g RAC集群启动关闭管理


1.切换到集群用户grid

[root@rac1 ~]# su - grid

2.查看集群资源状态(ora.gsd 11G不使用此资源 所以OFFLINE为正常状态)

[grid@rac1 ~]$ crs_stat -tName           Type           Target    State     Host        ora.CRSDG.dg   ora....up.type ONLINE    ONLINE    rac1        ora.DATADG.dg  ora....up.type ONLINE    ONLINE    rac1        ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1        ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac2        ora.asm        ora.asm.type   ONLINE    ONLINE    rac1        ora.bnuoa.db   ora....se.type ONLINE    ONLINE    rac1        ora.cvu        ora.cvu.type   ONLINE    ONLINE    rac2        ora.gsd        ora.gsd.type   OFFLINE   OFFLINE               ora....network ora....rk.type ONLINE    ONLINE    rac1        ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    rac2        ora.ons        ora.ons.type   ONLINE    ONLINE    rac1        ora....SM1.asm application    ONLINE    ONLINE    rac1        ora....C1.lsnr application    ONLINE    ONLINE    rac1        ora.rac1.gsd   application    OFFLINE   OFFLINE               ora.rac1.ons   application    ONLINE    ONLINE    rac1        ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1        ora....SM2.asm application    ONLINE    ONLINE    rac2        ora....C2.lsnr application    ONLINE    ONLINE    rac2        ora.rac2.gsd   application    OFFLINE   OFFLINE               ora.rac2.ons   application    ONLINE    ONLINE    rac2        ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2        ora....ry.acfs ora....fs.type ONLINE    ONLINE    rac1        ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac2        

3.关闭服务器步骤

1)关闭数据库(两个节点都要执行) ORACLE用户-------第一节点[root@rac1 ~]# su - oracle[oracle@rac1 ~]$ echo $ORACLE_SIDbnuoa1[oracle@rac1 ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Tue Oct 20 09:59:29 2015Copyright (c) 1982, 2011, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,Data Mining and Real Application Testing optionsSQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL>-------第二节点[oracle@rac2 ~]$ sqlplus / as sysdbaSQL*Plus: Release 11.2.0.3.0 Production on Tue Oct 20 10:02:27 2015Copyright (c) 1982, 2011, Oracle.  All rights reserved.Connected to:Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,Data Mining and Real Application Testing optionsSQL> shutdown immediateDatabase closed.Database dismounted.ORACLE instance shut down.SQL>(2)关闭集群(一个节点执行即可,等待时间较长)ROOT用户[root@rac1 ~]# cd /u01/app/11.2.0/grid/bin/[root@rac1 bin]# ./crsctl  stop  cluster  -allCRS-2673: Attempting to stop 'ora.crsd' on 'rac1'CRS-2673: Attempting to stop 'ora.crsd' on 'rac2'CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac2'CRS-2673: Attempting to stop 'ora.CRSDG.dg' on 'rac2'CRS-2673: Attempting to stop 'ora.registry.acfs' on 'rac2'CRS-2673: Attempting to stop 'ora.DATADG.dg' on 'rac2'CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac1'CRS-2673: Attempting to stop 'ora.CRSDG.dg' on 'rac1'CRS-2673: Attempting to stop 'ora.registry.acfs' on 'rac1'CRS-2673: Attempting to stop 'ora.DATADG.dg' on 'rac1'CRS-2677: Stop of 'ora.DATADG.dg' on 'rac1' succeededCRS-2677: Stop of 'ora.DATADG.dg' on 'rac2' succeededCRS-2677: Stop of 'ora.registry.acfs' on 'rac1' succeededCRS-2677: Stop of 'ora.registry.acfs' on 'rac2' succeededCRS-2677: Stop of 'ora.CRSDG.dg' on 'rac2' succeededCRS-2673: Attempting to stop 'ora.asm' on 'rac2'CRS-2677: Stop of 'ora.CRSDG.dg' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.asm' on 'rac1'CRS-2677: Stop of 'ora.asm' on 'rac2' succeededCRS-2673: Attempting to stop 'ora.net1.network' on 'rac2'CRS-2677: Stop of 'ora.net1.network' on 'rac2' succeededCRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac2' has completedCRS-2677: Stop of 'ora.asm' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.net1.network' on 'rac1'CRS-2677: Stop of 'ora.net1.network' on 'rac1' succeededCRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac1' has completedCRS-2677: Stop of 'ora.crsd' on 'rac2' succeededCRS-2673: Attempting to stop 'ora.ctssd' on 'rac2'CRS-2673: Attempting to stop 'ora.evmd' on 'rac2'CRS-2673: Attempting to stop 'ora.asm' on 'rac2'CRS-2677: Stop of 'ora.crsd' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.ctssd' on 'rac1'CRS-2673: Attempting to stop 'ora.evmd' on 'rac1'CRS-2673: Attempting to stop 'ora.asm' on 'rac1'CRS-2677: Stop of 'ora.evmd' on 'rac1' succeededCRS-2677: Stop of 'ora.evmd' on 'rac2' succeededCRS-2677: Stop of 'ora.asm' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac1'CRS-2677: Stop of 'ora.asm' on 'rac2' succeededCRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac2'CRS-2677: Stop of 'ora.ctssd' on 'rac2' succeededCRS-2677: Stop of 'ora.ctssd' on 'rac1' succeededCRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.cssd' on 'rac1'CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac2' succeededCRS-2673: Attempting to stop 'ora.cssd' on 'rac2'CRS-2677: Stop of 'ora.cssd' on 'rac1' succeededCRS-2677: Stop of 'ora.cssd' on 'rac2' succeeded(3)查看集群状态。[grid@rac1 ~]$ crs_stat -tCRS-0184: Cannot communicate with the CRS daemon.(4)当前可正常关闭服务器。

4.开启服务器步骤

1)正常情况下重启服务器,集群会自动启动(等待时间15-20分钟)(2)手动启动,先查看集群状态[root@rac1 bin]# su - grid[grid@rac1 ~]$ crs_stat -tName           Type           Target    State     Host        ------------------------------------------------------------ora.CRSDG.dg   ora....up.type OFFLINE   OFFLINE               ora.DATADG.dg  ora....up.type OFFLINE   OFFLINE               ora....ER.lsnr ora....er.type OFFLINE   OFFLINE               ora....N1.lsnr ora....er.type OFFLINE   OFFLINE               ora.asm        ora.asm.type   OFFLINE   OFFLINE               ora.bnuoa.db   ora....se.type OFFLINE   OFFLINE               ora.cvu        ora.cvu.type   OFFLINE   OFFLINE               ora.gsd        ora.gsd.type   OFFLINE   OFFLINE               ora....network ora....rk.type OFFLINE   OFFLINE               ora.oc4j       ora.oc4j.type  OFFLINE   OFFLINE               ora.ons        ora.ons.type   OFFLINE   OFFLINE               ora....SM1.asm application    OFFLINE   OFFLINE               ora....C1.lsnr application    OFFLINE   OFFLINE               ora.rac1.gsd   application    OFFLINE   OFFLINE               ora.rac1.ons   application    OFFLINE   OFFLINE               ora.rac1.vip   ora....t1.type OFFLINE   OFFLINE               ora....SM2.asm application    OFFLINE   OFFLINE               ora....C2.lsnr application    OFFLINE   OFFLINE               ora.rac2.gsd   application    OFFLINE   OFFLINE               ora.rac2.ons   application    OFFLINE   OFFLINE               ora.rac2.vip   ora....t1.type OFFLINE   OFFLINE               ora....ry.acfs ora....fs.type OFFLINE   OFFLINE               (3)手动启动,启动集群(一个节点执行即可) ROOT用户[root@rac1 ~]# cd /u01/app/11.2.0/grid/bin/[root@rac1 bin]# ./crsctl start cluster -n rac1 rac2CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac2'CRS-2676: Start of 'ora.cssdmonitor' on 'rac2' succeededCRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeededCRS-2672: Attempting to start 'ora.cssd' on 'rac1'CRS-2672: Attempting to start 'ora.cssd' on 'rac2'CRS-2672: Attempting to start 'ora.diskmon' on 'rac2'CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'CRS-2676: Start of 'ora.diskmon' on 'rac2' succeededCRS-2676: Start of 'ora.diskmon' on 'rac1' succeededCRS-2676: Start of 'ora.cssd' on 'rac1' succeededCRS-2672: Attempting to start 'ora.ctssd' on 'rac1'CRS-2676: Start of 'ora.cssd' on 'rac2' succeededCRS-2672: Attempting to start 'ora.ctssd' on 'rac2'CRS-2676: Start of 'ora.ctssd' on 'rac1' succeededCRS-2672: Attempting to start 'ora.evmd' on 'rac1'CRS-2676: Start of 'ora.ctssd' on 'rac2' succeededCRS-2672: Attempting to start 'ora.evmd' on 'rac2'CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'rac1'CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'rac2'CRS-2676: Start of 'ora.evmd' on 'rac1' succeededCRS-2676: Start of 'ora.evmd' on 'rac2' succeededCRS-2676: Start of 'ora.cluster_interconnect.haip' on 'rac2' succeededCRS-2672: Attempting to start 'ora.asm' on 'rac2'CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'rac1' succeededCRS-2672: Attempting to start 'ora.asm' on 'rac1'CRS-2676: Start of 'ora.asm' on 'rac1' succeededCRS-2672: Attempting to start 'ora.crsd' on 'rac1'CRS-2676: Start of 'ora.asm' on 'rac2' succeededCRS-2672: Attempting to start 'ora.crsd' on 'rac2'CRS-2676: Start of 'ora.crsd' on 'rac1' succeededCRS-2676: Start of 'ora.crsd' on 'rac2' succeeded2.查看集群资源状态(ora.gsd 11G不使用此资源 所以OFFLINE为正常状态)[grid@rac1 ~]$ crs_stat -tName           Type           Target    State     Host------------------------------------------------------------ora.CRSDG.dg   ora....up.type ONLINE    ONLINE    rac1ora.DATADG.dg  ora....up.type ONLINE    ONLINE    rac1ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac1ora.asm        ora.asm.type   ONLINE    ONLINE    rac1ora.bnuoa.db   ora....se.type ONLINE    ONLINE    rac1ora.cvu        ora.cvu.type   ONLINE    ONLINE    rac1ora.gsd        ora.gsd.type   OFFLINE   OFFLINEora....network ora....rk.type ONLINE    ONLINE    rac1ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    rac1ora.ons        ora.ons.type   ONLINE    ONLINE    rac1ora....SM1.asm application    ONLINE    ONLINE    rac1ora....C1.lsnr application    ONLINE    ONLINE    rac1ora.rac1.gsd   application    OFFLINE   OFFLINEora.rac1.ons   application    ONLINE    ONLINE    rac1ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1ora....SM2.asm application    ONLINE    ONLINE    rac2ora....C2.lsnr application    ONLINE    ONLINE    rac2ora.rac2.gsd   application    OFFLINE   OFFLINEora.rac2.ons   application    ONLINE    ONLINE    rac2ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2ora....ry.acfs ora....fs.type ONLINE    ONLINE    rac1ora.scan1.vip  ora....ip.type ONLINE    ONLINE    rac1
0 0
原创粉丝点击