crsctl stat res -t 有时显示很多,简单查看哪些是offline的用ps不方便
crsctl本身就有过滤功能设计
crsctl stat res -h
看到
...
Sample filters:
1. TYPE = type1
2. ((TYPE = type1) AND (CHECK_INTERVAL > 50))
3. (TYPE = type1) AND ((CHECK_INTERVAL > 30) OR (AUTO_START co never))
Filter Operators: =, >, <, !=, co, st, en, nc, nci, coi, eqi
where
co --> contains 包含
st --> starts with 从什么开始
en --> ends with 以什么结束
nc --> does not contain 不包含
coi --> contains, case-insensitive 包含大小写敏感
nci --> does not contain, case-insensitive
eqi --> equals, case-insensitive 等于大小写敏感
Sample command: crsctl status resource -w "TYPE = type1"
如果想查看哪些OFFLINE,则
crsctl stat res -t -init -w "(STATE = OFFLINE) and (NAME != ora.crf) and (NAME != ora.diskmon) and (NAME != ora.cha)"
crsctl stat res -t -w "(STATE = OFFLINE) and (NAME != ora.proxy_advm)"
crsctl stat res -t -w "NAME co prim"
例如:
[grid@db1-[+ASM1]-/home/grid]$ crsctl stat res -t -w "(STATE = OFFLINE) and (NAME != ora.proxy_advm)"
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ARCHDG.dg(ora.asmgroup)
3 OFFLINE OFFLINE STABLE
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
3 ONLINE OFFLINE STABLE
ora.DATADG.dg(ora.asmgroup)
3 OFFLINE OFFLINE STABLE
ora.OCRDG.dg(ora.asmgroup)
3 OFFLINE OFFLINE STABLE
ora.asm(ora.asmgroup)
3 OFFLINE OFFLINE STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
3 OFFLINE OFFLINE STABLE
--------------------------------------------------------------------------------
看到磁盘组等资源都是不正常的
再测试一个
[grid@db1-[+ASM1]-/home/grid]$ crsctl stop res ora.storage -init
CRS-2673: Attempting to stop 'ora.storage' on 'db1'
CRS-2677: Stop of 'ora.storage' on 'db1' succeeded
[grid@db1-[+ASM1]-/home/grid]$ crsctl stat res -t -init -w "(STATE = OFFLINE) and (NAME != ora.crf) and (NAME != ora.diskmon) and (NAME != ora.cha)"
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.storage
1 OFFLINE OFFLINE STABLE
--------------------------------------------------------------------------------