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: Jared Still <jkstill_at_gmail.com>
Date: Mon, 1 May 2006 10:00:33 -0700
Message-ID: <bf46380605011000y1fda963jd763d219dbcea510@mail.gmail.com>


That script is simple to break.

eg. do 'alter system enable restricted session'

This script will not notify you that users cannot login.

Jared

On 5/1/06, Michael McMullen <ganstadba_at_hotmail.com> wrote:
>
> This is the most elegant one I've seen. You don't need a real oracle
> username/password. This has the added benefit of checking the listener. As
> stated by everyone else, don't have something automatically start the
> database. I don't even do it on a server reboot. Databases crash for a
> reason. This reason needs to be investigated. Just have the mailx go to a
> pager.
>
> Mike
>
> export
>
> PATH="/bin:/usr/bin:/usr/ucb:/etc:/usr:/usr/css/bin:/usr/ccs/lib:/usr/privat
>
> e/etc:/usr/private/etc/raddb:/usr/sbin:/opt/bin:/u01/app/oracle/product/9.2/
>
> bin:/opt/perl5/lib/5.00503:/opt/expect/expect/expect-RUN/opt/expect/lib:/opt
> /tcl-8.0/tcl/tcl-RUN/opt/tcl-8.0/lib"
> export ORACLE_HOME="/u01/app/oracle/product/9.2"
> export SHLIB_PATH="/u01/app/oracle/product/9.2/lib:/usr/lib"
> export ORACLE_BASE="/u01/app/oracle"
> export SHELL="/usr/bin/ksh"
>
> MAILLIST="yourmaillisthere_at_mail.com"
>
> if [ "$1" ]
> then DBNAME=$1
> else echo "\nOracle SID has not been entered."
> exit 16
> fi
>
> sqlplus -silent << EOF > /tmp/$$.1
> whenever sqlerror exit
> a/a@${DBNAME}
> exit;
> EOF
> egrep 'ORA-121|ORA-01034' /tmp/$$.1 > /dev/null
> if [[ $? = 0 ]]
> then
> mailx -s " ${DBNAME} is not accessible - db is down" ${MAILLIST} <
> /tmp/$$.1
> else
> grep 'ORA-01017' /tmp/$$.1 > /dev/null
> if [[ $? = 0 ]]
> then
> exit 16
> else
> mailx -s " ${DBNAME} is not accessible - db is down" ${MAILLIST} <
> /tmp/$$.1
> fi
> fi
>
> rm /tmp/$$.1
>
> exit
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

--
Jared Still
Certifiable Oracle DBA and Part Time Perl Evangelist

--
http://www.freelists.org/webpage/oracle-l
Received on Mon May 01 2006 - 12:00:33 CDT

Original text of this message

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