DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Monday, March 10, 2014

Script to check if sql connectivity hangs in RAC nodes due to different issues


### Schedule the script in crontab every 2 minutes based on need, to check if the sql connectivity is ### successful without hanging in each RAC node.


mail_id=`cat /home/oracle/scripts/mail_members.txt`
file=/home/oracle/scripts/logs/1.log
if [ -f $file ];
then
    echo " sqlplus not connected  " >> /home/oracle/scripts/logs/sql.log
    cat /home/oracle/scripts/logs/sql.log | mailx -s "sqlplus not connected" $mail_id
else
    touch /home/oracle/scripts/logs/1.log
    . /home/oracle/oracle.env
    sqlplus -s "/ as sysdba" << EOF
        spool out.log
        select name from v\$database;
        spool off;
    EOF
    rm /home/oracle/scripts/logs/1.log
fi

### If on any instance the sql connectivity hangs and you are intimated. After fixing the issue remove ### the file /home/oracle/scripts/logs/1.log.

1 comment:

Sridevi K said...

Regards
Sridevi Koduru (Senior Oracle Apps Trainer Oracleappstechnical.com)
LinkedIn profile - https://in.linkedin.com/in/sridevi-koduru-9b876a8b
Please Contact for One to One Online Training on Oracle Apps Technical, Financials, SCM, SQL, PL/SQL, D2K at training@oracleappstechnical.com | +91 - 9581017828.