Pavan DBA's Blog

The DBA Knowledge Store

Archive for the ‘RAC’ Category

script to check db status in rac env

Posted by Pavan DBA on May 24, 2012

script to check db status in rac env


setenv ORATAB /var/opt/oracle/oratab
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;

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

%d bloggers like this: