重庆思庄Oracle、Redhat认证学习论坛

标题: 如何验证oracle 12.2 rac 中 diagsnap.pl 是否执行 [打印本页]

作者: 郑全    时间: 2017-6-23 12:21
标题: 如何验证oracle 12.2 rac 中 diagsnap.pl 是否执行
--验证diagsnap.pl 是否执行
--以 grid用户登录
# su - grid
$
unset DIAGSNAP_OUTPUT
unset DIAGSNAP_EXECUTING
DIAGSNAP_OUTPUT=$(ps -ef | grep $ORACLE_HOME | grep diagsnap | grep -v grep)
DIAGSNAP_EXECUTING=$(echo "$DIAGSNAP_OUTPUT" | grep -c diagsnap)
if [ $DIAGSNAP_EXECUTING -gt 0 ]
then
echo -e "WARNING: \"diagsnap.pl\" is executing on this database server:\nDetails: $DIAGSNAP_OUTPUT"
else
echo -e "SUCCESS: \"diagsnap.pl\" is not executing on this database server.\nDetails: $DIAGSNAP_OUTPUT"
fi

如果启用了,结果如下:  
example of a "FAILURE:" result:
WARNING: "diagsnap.pl" is executing on this database server:
Details: root      74995  18129  0 12:07 ?        00:00:00 /u01/app/grid/product/12.2.0/grid/perl/bin/perl /u01/app/grid/product/12.2.0/grid/bin/diagsnap.pl start

如果没有启用,结果如下:
The expected output is:
SUCCESS: "diagsnap.pl" is not executing on this database server.
Details:

--如果启用了,想关闭:
[grid@rac1 ~]$ oclumon manage -disable diagsnap
Diagsnap option is successfully disabled on rac1
Diagsnap option is successfully disabled on rac2
Successfully Disabled diagsnap

作者: 郑全    时间: 2017-6-23 12:24
在只有一个节点的情况下,我们执行
oclumon manage -disable diagsnap
或则
oclumon manage -enable diagsnap

会报失败:

[grid@rac1 ~]$ oclumon manage -enable diagsnap
LoggerD --> Error connecting with node rac2

Failed to Enable diagsnap

没有关系,存在的这个节点会成功,结果可以通过上面的脚本进行校验.





欢迎光临 重庆思庄Oracle、Redhat认证学习论坛 (http://bbs.cqsztech.com/) Powered by Discuz! X3.2