Re: Administration script to check DB

From: Wario <sergeant.rock_at_gmail.com>
Date: 14 Sep 2004 11:43:56 -0700
Message-ID: <c75b43bb.0409141043.5e61a96d_at_posting.google.com>


  1. You did not say what OS, so let's assume UNIX. Create a script.

    sqlplus -L user/password_at_oracle_sid << END_SQL

        whenever sqlerror exit 1
        select sysdate from dual;

    END_SQL     if [ $? -eq 0 ]
    then

        echo Successful
    else

        echo Failed
    fi

NOTE: The return code will be 1 only is logon was successful and select statement fails. Which happens when the database is closed.

2. You will see a failed message everytime a logon fails.

Wario
Oracle DBA Received on Tue Sep 14 2004 - 20:43:56 CEST

Original text of this message