ORACLE RAC CRSCTL 命令使用 及 执行的用户
(2016-04-06 14:09:57)| 分类: ORACLE |
oracle rac crsctl命令使用
查看crs资源状态
[grid@db1 ~]$ crs_stat -t
Name
Type
Target
State Host
------------------------------------------------------------
ora.DATA.dg
ora....up.type ONLINE
ONLINE db1
ora.FRA.dg
ora....up.type ONLINE ONLINE
db1
ora....ER.lsnr ora....er.type ONLINE
ONLINE db1
ora....N1.lsnr ora....er.type ONLINE
ONLINE db1
ora.OCR.dg
ora....up.type ONLINE ONLINE
db1
ora.asm
ora.asm.type
ONLINE
ONLINE db1
ora.cvu
ora.cvu.type
ONLINE
ONLINE db1
ora....SM1.asm application
ONLINE
ONLINE db1
ora....B1.lsnr application
ONLINE
ONLINE db1
ora.db1.gsd application
OFFLINE
OFFLINE
ora.db1.ons application
ONLINE
ONLINE db1
ora.db1.vip
ora....t1.type ONLINE
ONLINE db1
ora....SM2.asm application
ONLINE
ONLINE db2
ora....B2.lsnr application
ONLINE
ONLINE db2
ora.db2.gsd application
OFFLINE
OFFLINE
ora.db2.ons application
ONLINE
ONLINE db2
ora.db2.vip
ora....t1.type ONLINE
ONLINE db2
ora.dmzdb.db ora....se.type ONLINE
ONLINE
db1
ora.gsd
ora.gsd.type
OFFLINE OFFLINE
ora....network ora....rk.type ONLINE
ONLINE db1
ora.oc4j
ora.oc4j.type ONLINE
ONLINE
db1
ora.ons
ora.ons.type
ONLINE
ONLINE db1
ora.scan1.vip ora....ip.type ONLINE
ONLINE
db1
查看资源状态
--------------------------------------------------------------------------------
NAME
TARGET
STATE
SERVER
STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ora.FRA.dg
ora.LISTENER.lsnr
ora.OCR.dg
ora.asm
ora.gsd
ora.net1.network
ora.ons
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
ora.cvu
ora.db1.vip
ora.db2.vip
ora.dmzdb.db
ora.oc4j
ora.scan1.vip
[grid@db1 ~]$
查看资源
[grid@db1 ~]$ crs_stat
NAME=ora.DATA.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINE on db1
NAME=ora.FRA.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINE on db1
NAME=ora.LISTENER.lsnr
TYPE=ora.listener.type
TARGET=ONLINE
STATE=ONLINE on db1
NAME=ora.LISTENER_SCAN1.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=ONLINE on db1
NAME=ora.OCR.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINE on db1
NAME=ora.asm
TYPE=ora.asm.type
TARGET=ONLINE
STATE=ONLINE on db1
NAME=ora.cvu
TYPE=ora.cvu.type
TARGET=ONLINE
STATE=ONLINE on db1
NAME=ora.db1.ASM1.asm
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db1
NAME=ora.db1.LISTENER_DB1.lsnr
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db1
NAME=ora.db1.gsd
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.db1.ons
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db1
NAME=ora.db1.vip
TYPE=ora.cluster_vip_net1.type
TARGET=ONLINE
STATE=ONLINE on db1
NAME=ora.db2.ASM2.asm
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db2
NAME=ora.db2.LISTENER_DB2.lsnr
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db2
NAME=ora.db2.gsd
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.db2.ons
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db2
NAME=ora.db2.vip
TYPE=ora.cluster_vip_net1.type
TARGET=ONLINE
STATE=ONLINE on db2
NAME=ora.dmzdb.db
TYPE=ora.database.type
TARGET=ONLINE
STATE=ONLINE on db1
NAME=ora.gsd
TYPE=ora.gsd.type
TARGET=OFFLINE
STATE=OFFLINE
NAME=ora.net1.network
TYPE=ora.network.type
TARGET=ONLINE
STATE=ONLINE on db1
NAME=ora.oc4j
TYPE=ora.oc4j.type
TARGET=ONLINE
STATE=ONLINE on db1
NAME=ora.ons
TYPE=ora.ons.type
TARGET=ONLINE
STATE=ONLINE on db1
NAME=ora.scan1.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on db1
[grid@db1 ~]$
check crs 状态
[grid@db1 ~]$ crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
root用户下加入如下内容
export ORACLE_HOME=/u01/app/11.2.0/grid/
PATH=${PATH}:$ORACLE_HOME/bin
[root@db1 ~]# cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
export ORACLE_HOME=/u01/app/11.2.0/grid/
PATH=${PATH}:$ORACLE_HOME/bin
[root@db1 ~]#
停crs之前一般要停监听,停库(先停监听,在停库,防止新会话上来)
[grid@db1 ~]$ srvctl stop listener -n
db1
[grid@db1 ~]$ srvctl stop instance -d dmzdb
-i dmzdb1
停db1 crs
[root@db1 ~]# crsctl stop crs
CRS-2791: Starting shutdown of Oracle High Availability
Services-managed resources on 'db1'
CRS-2673: Attempting to stop 'ora.crsd' on 'db1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed
resources on 'db1'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'db1'
CRS-2673: Attempting to stop 'ora.OCR.dg' on 'db1'
CRS-2673: Attempting to stop 'ora.dmzdb.db' on 'db1'
CRS-2673: Attempting to stop 'ora.oc4j' on 'db1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on
'db1'
CRS-2673: Attempting to stop 'ora.cvu' on 'db1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on
'db1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.db1.vip' on 'db1'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'db1'
succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'db1'
CRS-2677: Stop of 'ora.db1.vip' on 'db1' succeeded
CRS-2672: Attempting to start 'ora.db1.vip' on 'db2'
CRS-2677: Stop of 'ora.scan1.vip' on 'db1' succeeded
CRS-2672: Attempting to start 'ora.scan1.vip' on 'db2'
CRS-2677: Stop of 'ora.FRA.dg' on 'db1' succeeded
CRS-2677: Stop of 'ora.dmzdb.db' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'db1'
CRS-2676: Start of 'ora.db1.vip' on 'db2' succeeded
CRS-2676: Start of 'ora.scan1.vip' on 'db2' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on
'db2'
CRS-2677: Stop of 'ora.DATA.dg' on 'db1' succeeded
CRS-2677: Stop of 'ora.oc4j' on 'db1' succeeded
CRS-2672: Attempting to start 'ora.oc4j' on 'db2'
CRS-2677: Stop of 'ora.cvu' on 'db1' succeeded
CRS-2672: Attempting to start 'ora.cvu' on 'db2'
CRS-2676: Start of 'ora.cvu' on 'db2' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'db2'
succeeded
CRS-2676: Start of 'ora.oc4j' on 'db2' succeeded
CRS-2677: Stop of 'ora.OCR.dg' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'db1'
CRS-2677: Stop of 'ora.asm' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'db1'
CRS-2677: Stop of 'ora.ons' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'db1'
CRS-2677: Stop of 'ora.net1.network' on 'db1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources
on 'db1' has completed
CRS-2677: Stop of 'ora.crsd' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.crf' on 'db1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'db1'
CRS-2673: Attempting to stop 'ora.evmd' on 'db1'
CRS-2673: Attempting to stop 'ora.asm' on 'db1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'db1'
CRS-2677: Stop of 'ora.crf' on 'db1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'db1' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'db1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'db1' succeeded
CRS-2677: Stop of 'ora.asm' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip'
on 'db1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'db1'
succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'db1'
CRS-2677: Stop of 'ora.cssd' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'db1'
CRS-2677: Stop of 'ora.gipcd' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'db1'
CRS-2677: Stop of 'ora.gpnpd' on 'db1' succeeded
CRS-2793: Shutdown of Oracle High Availability
Services-managed resources on 'db1' has completed
CRS-4133: Oracle High Availability Services has been
stopped.
[root@db1 ~]#
另一种停crs方法,停db1:
[grid@db1 ~]$ srvctl stop listener -n
db1
[grid@db1 ~]$ srvctl stop instance -d dmzdb
-i dmzdb1
[root@db1 ~]# crsctl stop cluster -n
db1
CRS-2673: Attempting to stop 'ora.crsd' on 'db1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed
resources on 'db1'
CRS-2673: Attempting to stop 'ora.db1.vip' on 'db1'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'db1'
CRS-2673: Attempting to stop 'ora.OCR.dg' on 'db1'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'db1'
CRS-2677: Stop of 'ora.db1.vip' on 'db1' succeeded
CRS-2672: Attempting to start 'ora.db1.vip' on 'db2'
CRS-2677: Stop of 'ora.FRA.dg' on 'db1' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'db1' succeeded
CRS-2676: Start of 'ora.db1.vip' on 'db2' succeeded
CRS-2677: Stop of 'ora.OCR.dg' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'db1'
CRS-2677: Stop of 'ora.asm' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'db1'
CRS-2677: Stop of 'ora.ons' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'db1'
CRS-2677: Stop of 'ora.net1.network' on 'db1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources
on 'db1' has completed
CRS-2677: Stop of 'ora.crsd' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'db1'
CRS-2673: Attempting to stop 'ora.evmd' on 'db1'
CRS-2673: Attempting to stop 'ora.asm' on 'db1'
CRS-2677: Stop of 'ora.evmd' on 'db1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'db1' succeeded
CRS-2677: Stop of 'ora.asm' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip'
on 'db1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'db1'
succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'db1'
CRS-2677: Stop of 'ora.cssd' on 'db1' succeeded
[root@db1 ~]#
启动crs ,db1为例子
[root@db1 ~]#
[root@db1 ~]# crsctl start cluster -n
db1
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'db1'
CRS-2676: Start of 'ora.cssdmonitor' on 'db1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'db1'
CRS-2672: Attempting to start 'ora.diskmon' on 'db1'
CRS-2676: Start of 'ora.diskmon' on 'db1' succeeded
CRS-2676: Start of 'ora.cssd' on 'db1' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'db1'
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip'
on 'db1'
CRS-2676: Start of 'ora.ctssd' on 'db1' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'db1'
CRS-2676: Start of 'ora.evmd' on 'db1' succeeded
CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'db1'
succeeded
CRS-2672: Attempting to start 'ora.asm' on 'db1'
CRS-2676: Start of 'ora.asm' on 'db1' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'db1'
CRS-2676: Start of 'ora.crsd' on 'db1' succeeded
[root@db1 ~]#
crsctl stop 全部节点(先停监听,停库,再停crs)
[grid@db1 ~]$ srvctl stop listener -n
db1
[grid@db1 ~]$ srvctl stop instance -d dmzdb
-i dmzdb1
[grid@db2 ~]$ srvctl stop listener -n
db2
[grid@db2 ~]$ srvctl stop instance -d dmzdb
-i dmzdb2
CRS-2673: Attempting to stop 'ora.crsd' on 'db1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed
resources on 'db1'
CRS-2673: Attempting to stop 'ora.db1.vip' on 'db1'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'db1'
CRS-2673: Attempting to stop 'ora.OCR.dg' on 'db1'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'db1'
CRS-2677: Stop of 'ora.db1.vip' on 'db1' succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'db1' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.crsd' on 'db2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed
resources on 'db2'
CRS-2673: Attempting to stop 'ora.FRA.dg' on 'db2'
CRS-2673: Attempting to stop 'ora.OCR.dg' on 'db2'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'db2'
CRS-2673: Attempting to stop 'ora.db2.vip' on 'db2'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on
'db2'
CRS-2673: Attempting to stop 'ora.oc4j' on 'db2'
CRS-2673: Attempting to stop 'ora.cvu' on 'db2'
CRS-2677: Stop of 'ora.db2.vip' on 'db2' succeeded
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'db2'
succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'db2'
CRS-2677: Stop of 'ora.scan1.vip' on 'db2' succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'db2' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'db2' succeeded
CRS-2677: Stop of 'ora.oc4j' on 'db2' succeeded
CRS-2677: Stop of 'ora.cvu' on 'db2' succeeded
CRS-2677: Stop of 'ora.OCR.dg' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'db1'
CRS-2677: Stop of 'ora.asm' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'db1'
CRS-2677: Stop of 'ora.ons' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'db1'
CRS-2677: Stop of 'ora.net1.network' on 'db1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources
on 'db1' has completed
CRS-2677: Stop of 'ora.crsd' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'db1'
CRS-2673: Attempting to stop 'ora.evmd' on 'db1'
CRS-2673: Attempting to stop 'ora.asm' on 'db1'
CRS-2677: Stop of 'ora.evmd' on 'db1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'db1' succeeded
CRS-2677: Stop of 'ora.OCR.dg' on 'db2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'db2'
CRS-2677: Stop of 'ora.asm' on 'db2' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'db2'
CRS-2677: Stop of 'ora.ons' on 'db2' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'db2'
CRS-2677: Stop of 'ora.net1.network' on 'db2' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources
on 'db2' has completed
CRS-2677: Stop of 'ora.asm' on 'db1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip'
on 'db1'
CRS-2677: Stop of 'ora.crsd' on 'db2' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'db2'
CRS-2673: Attempting to stop 'ora.evmd' on 'db2'
CRS-2673: Attempting to stop 'ora.asm' on 'db2'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'db1'
succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'db1'
CRS-2677: Stop of 'ora.evmd' on 'db2' succeeded
CRS-2677: Stop of 'ora.cssd' on 'db1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'db2' succeeded
CRS-2677: Stop of 'ora.asm' on 'db2' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip'
on 'db2'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'db2'
succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'db2'
CRS-2677: Stop of 'ora.cssd' on 'db2' succeeded
[root@db1 ~]#
启动全部节点命令
[root@db1 ~]# crsctl start cluster -all
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'db1'
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'db2'
CRS-2676: Start of 'ora.cssdmonitor' on 'db1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'db1'
CRS-2672: Attempting to start 'ora.diskmon' on 'db1'
CRS-2676: Start of 'ora.cssdmonitor' on 'db2' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'db2'
CRS-2672: Attempting to start 'ora.diskmon' on 'db2'
CRS-2676: Start of 'ora.diskmon' on 'db1' succeeded
CRS-2676: Start of 'ora.diskmon' on 'db2' succeeded
CRS-2676: Start of 'ora.cssd' on 'db1' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'db1'
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip'
on 'db1'
CRS-2676: Start of 'ora.cssd' on 'db2' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'db2'
CRS-2676: Start of 'ora.ctssd' on 'db1' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'db1'
CRS-2676: Start of 'ora.ctssd' on 'db2' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'db2'
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip'
on 'db2'
CRS-2676: Start of 'ora.evmd' on 'db1' succeeded
CRS-2676: Start of 'ora.evmd' on 'db2' succeeded
CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'db1'
succeeded
CRS-2672: Attempting to start 'ora.asm' on 'db1'
CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'db2'
succeeded
CRS-2672: Attempting to start 'ora.asm' on 'db2'
CRS-2676: Start of 'ora.asm' on 'db1' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'db1'
CRS-2676: Start of 'ora.crsd' on 'db1' succeeded
CRS-2676: Start of 'ora.asm' on 'db2' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'db2'
CRS-2676: Start of 'ora.crsd' on 'db2' succeeded
查看crs状态(实例与监听,后面启动)
[root@db1 ~]# crsctl stat res -t
--------------------------------------------------------------------------------
NAME
TARGET
STATE
SERVER
STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
ora.FRA.dg
ora.LISTENER.lsnr
ora.OCR.dg
ora.asm
ora.gsd
ora.net1.network
ora.ons
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
ora.cvu
ora.db1.vip
ora.db2.vip
ora.dmzdb.db
ora.oc4j
ora.scan1.vip
[root@db1 ~]#
[
crsctl -h 查看帮助
[root@db1 ~]# crsctl -h
Usage: crsctl add
- add a resource, type or other entity
[root@db1 ~]# crsctl start -h
Usage:

加载中…