Pavan DBA's Blog

The DBA Knowledge Store

Posts Tagged ‘script to check db status in rac env’

script to check db status in rac env

Posted by Pavan DBA on May 24, 2012


***************************************************
script to check db status in rac env
***************************************************

#!/bin/csh

setenv ORATAB /var/opt/oracle/oratab
date
foreach x (`cat ${ORATAB} | grep -v “^#”| grep “^[a-z]” | grep -v “demo” | grep -v “_sp”|awk -F: ‘{print $1}’`)
        setenv ORAENV_ASK 1
        setenv ORACLE_SID “$x”
        source /usr/local/default/oracle_sid.csh
            $ORACLE_HOME/bin/sqlplus -s <<EOF
        / as sysdba
        set lines 132
        set pages 200
            set hea off
        set feedback off
        col machine for a30
        col host_name for a40
        select instance_name, host_name, logins, status from gv\$instance;
        exit
EOF
end

Posted in RAC, Scripts | Tagged: | Leave a Comment »

 
%d bloggers like this: