crs_stat -t Name Type Target State Host ------------------------------------------------------------ ora.DATA.dg ora....up.type ONLINE ONLINE node1 ora....ER.lsnr ora....er.type ONLINE ONLINE node1 ora....N1.lsnr ora....er.type ONLINE ONLINE node2 ora....N2.lsnr ora....er.type ONLINE ONLINE node1 ora....N3.lsnr ora....er.type ONLINE ONLINE node1 ora.OCR.dg ora....up.type ONLINE ONLINE node1 ora.VOTING.dg ora....up.type ONLINE ONLINE node1 ora.asm ora.asm.type ONLINE ONLINE node1 ora.eons ora.eons.type ONLINE ONLINE node1 ora.gsd ora.gsd.type OFFLINE OFFLINE ora.lotest.db ora....se.type ONLINE ONLINE node1 ora....network ora....rk.type ONLINE ONLINE node1 ora....SM1.asm application ONLINE ONLINE node1 ora....E1.lsnr application ONLINE ONLINE node1 ora.node1.gsd application OFFLINE OFFLINE ora.node1.ons application ONLINE ONLINE node1 ora.node1.vip ora....t1.type ONLINE ONLINE node1 ora....SM2.asm application ONLINE ONLINE node2 ora....E2.lsnr application ONLINE OFFLINE ora.node2.gsd application OFFLINE OFFLINE ora.node2.ons application ONLINE ONLINE node2 ora.node2.vip ora....t1.type ONLINE ONLINE node2 ora.oc4j ora.oc4j.type OFFLINE OFFLINE ora.ons ora.ons.type ONLINE ONLINE node1 ora....ry.acfs ora....fs.type ONLINE ONLINE node1 ora.scan1.vip ora....ip.type ONLINE ONLINE node2 ora.scan2.vip ora....ip.type ONLINE ONLINE node1 ora.scan3.vip ora....ip.type ONLINE ONLINE node1
可以直观的列出各节点进程的状态。 但是这个命令的不足之处,就是Name列,不能显示全,那么在使用的时候就有点不方便。比如我们启动和关闭相关进程的时候。
比如:crs_start ora.node2.LISTENER_NODE2.lsnr
--我们这里要写全进程的名称,如果名称过长,就不能显示全。
其实这个脚本不够是把crs_stat 显示 行转列下而已。
那么我们来修理下ORACLE公司开发人员,这群丫的拿了钱,做的不咋友好。不就是脚本嘛! 我们DIY去。。。。
我们vi crstat.sh 编辑完后。mv crstat.sh crstat
付权限 chmod a+x crstat
然后切换成root用户下 cp crstat /bin 这样让root grid 用户都可以使用。
为了让oracle 用户也用上 vi ~/.bash_profile 添加
export GRID_BIN=/...........----grid用的 bin 主要是调用crs_stat命令 可以在grid用下which它下
这样我们就很爽了 随时随地敲入 crstat 就显示
[oracle@node1 dbscripts]$ crstat Name Type Target State Host ----------------------------------- ------------------------------ ---------- --------- ------- ora.DATA.dg ora.diskgroup.type ONLINE ONLINE node1 ora.LISTENER.lsnr ora.listener.type ONLINE ONLINE node1 ora.LISTENER_SCAN1.lsnr ora.scan_listener.type ONLINE ONLINE node2 ora.LISTENER_SCAN2.lsnr ora.scan_listener.type ONLINE ONLINE node1 ora.LISTENER_SCAN3.lsnr ora.scan_listener.type ONLINE ONLINE node1 ora.OCR.dg ora.diskgroup.type ONLINE ONLINE node1 ora.VOTING.dg ora.diskgroup.type ONLINE ONLINE node1 ora.asm ora.asm.type ONLINE ONLINE node1 ora.eons ora.eons.type ONLINE ONLINE node1 ora.gsd ora.gsd.type OFFLINE OFFLINE ora.lotest.db ora.database.type ONLINE ONLINE node1 ora.net1.network ora.network.type ONLINE ONLINE node1 ora.node1.ASM1.asm application ONLINE ONLINE node1 ora.node1.LISTENER_NODE1.lsnr application ONLINE ONLINE node1 ora.node1.gsd application OFFLINE OFFLINE ora.node1.ons application ONLINE ONLINE node1 ora.node1.vip ora.cluster_vip_net1.type ONLINE ONLINE node1 ora.node2.ASM2.asm application ONLINE ONLINE node2 ora.node2.LISTENER_NODE2.lsnr application ONLINE OFFLINE ora.node2.gsd application OFFLINE OFFLINE ora.node2.ons application ONLINE ONLINE node2 ora.node2.vip ora.cluster_vip_net1.type ONLINE ONLINE node2 ora.oc4j ora.oc4j.type OFFLINE OFFLINE ora.ons ora.ons.type ONLINE ONLINE node1 ora.registry.acfs ora.registry.acfs.type ONLINE ONLINE node1 ora.scan1.vip ora.scan_vip.type ONLINE ONLINE node2 ora.scan2.vip ora.scan_vip.type ONLINE ONLINE node1 ora.scan3.vip ora.scan_vip.type ONLINE ONLINE node1