database's docs

3.11.0 RAC-管理命令


1. 查看节点状态

# 查看节点名称列表
/u01/app/11.2.0/grid/bin/olsnodes
db-oracle-node1
db-oracle-node2

# 查看节点的vip
/u01/app/11.2.0/grid/bin/olsnodes -i
db-oracle-node1 db-oracle-node1-vip
db-oracle-node2 db-oracle-node2-vip

# 查看节点的激活状态
/u01/app/11.2.0/grid/bin/olsnodes -s
db-oracle-node1 Active
db-oracle-node2 Active

2. 查看节点资源状态

/u01/app/11.2.0/grid/bin/crs_stat
NAME=ora.DATADG.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.FRADG.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.LISTENER.lsnr
TYPE=ora.listener.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.LISTENER_SCAN1.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node2

NAME=ora.LISTENER_SCAN2.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.LISTENER_SCAN3.lsnr
TYPE=ora.scan_listener.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.OCRVOTE.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.REDODG.dg
TYPE=ora.diskgroup.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.asm
TYPE=ora.asm.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.cvu
TYPE=ora.cvu.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.db-oracle-node1.ASM1.asm
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.db-oracle-node1.LISTENER_DB-ORACLE-NODE1.lsnr
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.db-oracle-node1.gsd
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.db-oracle-node1.ons
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.db-oracle-node1.vip
TYPE=ora.cluster_vip_net1.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.db-oracle-node2.ASM2.asm
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db-oracle-node2

NAME=ora.db-oracle-node2.LISTENER_DB-ORACLE-NODE2.lsnr
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db-oracle-node2

NAME=ora.db-oracle-node2.gsd
TYPE=application
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.db-oracle-node2.ons
TYPE=application
TARGET=ONLINE
STATE=ONLINE on db-oracle-node2

NAME=ora.db-oracle-node2.vip
TYPE=ora.cluster_vip_net1.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node2

NAME=ora.gsd
TYPE=ora.gsd.type
TARGET=OFFLINE
STATE=OFFLINE

NAME=ora.net1.network
TYPE=ora.network.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.oc4j
TYPE=ora.oc4j.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.ons
TYPE=ora.ons.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.racdb.db
TYPE=ora.database.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.scan1.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node2

NAME=ora.scan2.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

NAME=ora.scan3.vip
TYPE=ora.scan_vip.type
TARGET=ONLINE
STATE=ONLINE on db-oracle-node1

## 以另外一种方式查看
/u01/app/11.2.0/grid/bin/crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.DATADG.dg  ora....up.type ONLINE    ONLINE    db-o...ode1
ora.FRADG.dg   ora....up.type ONLINE    ONLINE    db-o...ode1
ora....ER.lsnr ora....er.type ONLINE    ONLINE    db-o...ode1
ora....N1.lsnr ora....er.type ONLINE    ONLINE    db-o...ode2
ora....N2.lsnr ora....er.type ONLINE    ONLINE    db-o...ode1
ora....N3.lsnr ora....er.type ONLINE    ONLINE    db-o...ode1
ora.OCRVOTE.dg ora....up.type ONLINE    ONLINE    db-o...ode1
ora.REDODG.dg  ora....up.type ONLINE    ONLINE    db-o...ode1
ora.asm        ora.asm.type   ONLINE    ONLINE    db-o...ode1
ora.cvu        ora.cvu.type   ONLINE    ONLINE    db-o...ode1
ora....SM1.asm application    ONLINE    ONLINE    db-o...ode1
ora....E1.lsnr application    ONLINE    ONLINE    db-o...ode1
ora....de1.gsd application    OFFLINE   OFFLINE
ora....de1.ons application    ONLINE    ONLINE    db-o...ode1
ora....de1.vip ora....t1.type ONLINE    ONLINE    db-o...ode1
ora....SM2.asm application    ONLINE    ONLINE    db-o...ode2
ora....E2.lsnr application    ONLINE    ONLINE    db-o...ode2
ora....de2.gsd application    OFFLINE   OFFLINE
ora....de2.ons application    ONLINE    ONLINE    db-o...ode2
ora....de2.vip ora....t1.type ONLINE    ONLINE    db-o...ode2
ora.gsd        ora.gsd.type   OFFLINE   OFFLINE
ora....network ora....rk.type ONLINE    ONLINE    db-o...ode1
ora.oc4j       ora.oc4j.type  ONLINE    ONLINE    db-o...ode1
ora.ons        ora.ons.type   ONLINE    ONLINE    db-o...ode1
ora.racdb.db   ora....se.type ONLINE    ONLINE    db-o...ode1
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    db-o...ode2
ora.scan2.vip  ora....ip.type ONLINE    ONLINE    db-o...ode1
ora.scan3.vip  ora....ip.type ONLINE    ONLINE    db-o...ode1

3. 查看节点服务状态

# 查看crs服务,此服务监听集群所有的资源情况,对它们产生启动关闭切换等操作
/u01/app/11.2.0/grid/bin/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

# 查看时间服务ctss
/u01/app/11.2.0/grid/bin/crsctl check ctss
CRS-4700: The Cluster Time Synchronization Service is in Observer mode.

# 查看节点状态
/u01/app/11.2.0/grid/bin/crsctl check cluster -all
**************************************************************
db-oracle-node1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
db-oracle-node2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************

4. 查看ASM状态

## 查看系统进程
ps aux |grep ASM
grid      4757  0.0  0.3 499420 10700 ?        Ss   Dec29   0:20 asm_pmon_+ASM1
grid      4759  0.0  0.2 497040  6356 ?        Ss   Dec29   0:20 asm_psp0_+ASM1
grid      4761  2.7  0.2 497040  6084 ?        Ss   Dec29  39:20 asm_vktm_+ASM1
grid      4765  0.0  0.2 498464  7592 ?        Ss   Dec29   0:02 asm_gen0_+ASM1
grid      4767  0.1  0.5 503320 14944 ?        Ss   Dec29   1:28 asm_diag_+ASM1
grid      4769  0.0  0.2 497296  6728 ?        Ss   Dec29   0:16 asm_ping_+ASM1
grid      4771  0.4  0.8 509500 23872 ?        Ss   Dec29   6:28 asm_dia0_+ASM1
grid      4773  0.2  0.5 505512 16292 ?        Ss   Dec29   3:50 asm_lmon_+ASM1
...