浅试过滤集群中不想看到的资源

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
--------------------------------------------------------------------------------

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值