| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL command to determine if DB is open
/*************************************
**************************************/
WHENEVER SQLERROR EXIT sql.sqlcode;
select global_name from global_name_at_some_instance ;
exit 249
/*********** end ck_instance.sql ******/
On *nix box
sqlplus scott/tiger @ck_instance
if [ $? != 249 ] ; then
mailx -s "Oracle is down" amw157_at_aol.com < /dev/null
fi
On Micro$oft :(
set ERRORLEVEL=
sqlplus scott/tiger @ck_instance
if %ERRORLEVEL% == 249 goto passed_sql
(your dos code here)
:passed_sql
: "Andy Weiss" <amw157_at_aol.com> wrote in message
: news:6b0f7239.0108070910.40766f3f_at_posting.google.com...
: > I need a quick command that I can execute in SQL Plus to determine if
: > a database is open or not. Been wading through Oracle's documentation
: > hopelessly for hours.
-- While Alcatel may claim ownership of all my ideas (on or off the job), Alcatel does not claim any responsibility for them. Warranty expired when u opened this article and I will not be responsible for its contents or use.Received on Wed Aug 08 2001 - 11:57:20 CDT
![]() |
![]() |