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