crs_stat命令显示的结果看起来复杂且不够清晰,Paul Elbow, Enkitec两位作者提供了更人性化的显示脚本crsstat.下载地址:http://down.51cto.com/data/1453855
安装
建议使用root用户或者oracle用户来安装到 /usr/local/bin 目录,安装后在脚本所在目录生成crsstat.env文件,记录了以下内容:
GRID_HOME=/g01/app/11.2.0/grid
GRID_VER=11.2
步骤
# cd /usr/local/bin
# unzip crsstat.v1.2.2.zip
# mv crsstat.v1.2.2 crsstat
# chmod 755 crsstat
# ./crsstat
# chmod 644 crsstat.env
用法
[root@huntdb02 ~]# crsstat -h
Usage: crsstat [-h] [-c] [searchterm]
-h => print this message
-c => output the resources by cluster or local
Examples:
crsstat # show allresources
crsstat listener # only showlistener resources
crsstat database # only showdatabase resources
crsstat -c listener # only showdatabase resources sorted by cluster/local
Output Contains the following fields:
Resource Name
Resource Type, which includes an identifier C-Cluster and L-Local
Target State
Current State
Current Node (11gR2: or the last node in paraenthesis if the resource isOffline)
Failure Count (11gR2 only)
Restart Count (11gR2 only)
State Details (11gR2 only)
[root@huntdb02 ~]# crsstatdatabase
Resource Name Resource Type Target State Node FC RC State Details
-------------------------------------------------------- ---------- ------------ --------------- -- -- ---------------
ora.txzldb.db database C ONLINE ONLINE huntdb01 0 0 Open
ora.txzldb.db database C ONLINE ONLINE huntdb02 0 0 Open
[root@huntdb02 ~]# crsstat
Resource Name Resource Type Target State Node FC RC State Details
-------------------------------------------------------- ---------- ------------ --------------- -- -- ---------------
ora.BACKDG.dg diskgroup L ONLINE ONLINE huntdb01 0 0
ora.BACKDG.dg diskgroup L ONLINE ONLINE huntdb02 0 0
ora.DATA.dg diskgroup L ONLINE ONLINE huntdb01 0 0
ora.DATA.dg diskgroup L ONLINE ONLINE huntdb02 0 0
ora.LISTENER.lsnr Listener L ONLINE ONLINE huntdb01 0 0
ora.LISTENER.lsnr Listener L ONLINE ONLINE huntdb02 0 0
ora.LISTENER_SCAN1.lsnr SCAN Listener C ONLINE ONLINE huntdb02 0 0
ora.SYSTEMDG.dg diskgroup L ONLINE ONLINE huntdb01 0 0
ora.SYSTEMDG.dg diskgroup L ONLINE ONLINE huntdb02 0 0
ora.asm ASM L ONLINE ONLINE huntdb01 0 0 Started
ora.asm ASM L ONLINE ONLINE huntdb02 0 0 Started
ora.cvu cvu C ONLINE ONLINE huntdb02 0 0
ora.gsd Gbl SvcDaemon L ONLINE OFFLINE (huntdb01) 0 0
ora.gsd Gbl SvcDaemon L ONLINE OFFLINE (huntdb02) 0 0
ora.huntdb01.vip Cluster VIP C ONLINE ONLINE huntdb01 0 0
ora.huntdb02.vip Cluster VIP C ONLINE ONLINE huntdb02 0 0
ora.net1.network Network (VIP) L ONLINE ONLINE huntdb01 0 0
ora.net1.network Network (VIP) L ONLINE ONLINE huntdb02 0 0
ora.oc4j OC4J C ONLINE ONLINE huntdb02 0 0
ora.ons Ora NotifSvc L ONLINE ONLINE huntdb01 0 0
ora.ons Ora NotifSvc L ONLINE ONLINE huntdb02 0 0
ora.scan1.vip SCAN VIP C ONLINE ONLINE huntdb02 0 0
ora.txzldb.db database C ONLINE ONLINE huntdb01 0 0 Open
ora.txzldb.db database C ONLINE ONLINE huntdb02 0 0 Open
转载于:https://blog.51cto.com/hunt1574/1436657