Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: starting the database

Re: starting the database

From: Radoulov, Dimitre <cichomitiko_at_gmail.com>
Date: Mon, 1 May 2006 18:11:22 +0200
Message-ID: <004701c66d39$e5faa510$2c08310a@MPILA9>


> I'm looking to make a cronjob that will every 5 minutes check if the
> database is up, and if not, start it. Does anyone have a script that does
> this available?

Without crontab you could just run:

foracheck() {
sqlplus -s << EOF > /dev/null 2>&1
/ as sysdba
whenever sqlerror exit failure
select null from dual;
exit
EOF
}

forastart() {
sqlplus -s << EOF > /dev/null 2>&1
/ as sysdba
startup
exit
EOF
}

while :
  do

        foracheck || forastart
        sleep 300

done

Just kidding, I would consider Daniel Fink's answer.

Regards,
Dimitre

--
http://www.freelists.org/webpage/oracle-l
Received on Mon May 01 2006 - 11:11:22 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US