我写的oracleRAC状态监控脚本(在单位一直使用,比较稳定)

[oracle@racdb4 jk]$ cat jkstatus.sh
export ORACLE_SID=racdbidc2
echo "error2GO" > s.txt
sqlplus -s < status.sql  &> ss.txt
jjj=`cat s.txt|grep GO`
if [ $jjj = "GOOD" ];then
        #echo "Oracle --2 status good."
        mail -s "OracleRAC-2 OK." [email protected] < s.txt
else
        #echo "Oracle --2 error."
        mail -s "OracleRAC-2 error." [email protected] < s.txt
        #mail -s "OracleRAC-2 error." [email protected],[email protected] < s.txt
fi
 
[oracle@racdb4 jk]$ cat status.sql
jkadmin/llpw123
spool s.txt
set time on
set timing on
select qstatus from statustab;
spool off
quit
 
 
[oracle@racdb3 jk]$ cat jkstatus.sh
export ORACLE_SID=racdbidc1
echo "error1GO" > s.txt
sqlplus -s < status.sql &> ss.txt
jjj=`cat s.txt|grep GO`
if [ $jjj = "GOOD" ];then
        #echo "Oracle --1 status good."
        mail -s "OracleRAC-1 OK." [email protected] < s.txt
else
        #echo "Oracle --1 error."
        mail -s "OracleRAC-1 error." [email protected],[email protected] < s.txt
fi
 
[oracle@racdb3 jk]$ cat status.sql
jkadmin/llpw123
spool s.txt
set time on
set timing on
select qstatus from statustab;
spool off
quit
 
 

你可能感兴趣的:(oracle,职场,休闲)