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`
if [ -f $file ];
    echo " sqlplus not connected  " >> /home/oracle/scripts/logs/sql.log
    cat /home/oracle/scripts/logs/sql.log | mailx -s "sqlplus not connected" $mail_id
    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;
    rm /home/oracle/scripts/logs/1.log

### 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...

Sridevi Koduru (Senior Oracle Apps Trainer
LinkedIn profile -
Please Contact for One to One Online Training on Oracle Apps Technical, Financials, SCM, SQL, PL/SQL, D2K at | +91 - 9581017828.