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

Home -> Community -> Usenet -> c.d.o.server -> Re: Is Database Up?

Re: Is Database Up?

From: Matthias Hoys <anti_at_spam.com>
Date: Tue, 29 Aug 2006 18:53:01 +0200
Message-ID: <44f470f6$0$31459$ba620e4c@news.skynet.be>

"David Newman" <dnewman_at_maraudingpirates.org> wrote in message news:f6wlkp7mz2o.fsf_at_BOS004777.na.pxl.int...
> rob <rob_at_dsdelft.nl> writes:
>
>> Dimitre,
>>
>> One small remark : this exposes un/pw in ps -ef. It may not be an
>> issue for dedicated database servers but the fix is so easy why not
>> use it?
>>
>> session1#printf "%s\n%s\n" "whenever sqlerror exit failure" "select
>> null from dual;"|sqlplus -L user/pass_at_service_name >/dev/null
>> 2>&1||echo "Database NOT accessible\!"
>>
>> session2#ps -ef|grep sqlplus
>> oracle 4724 29668 1 13:01:31 pts/2 0:01 sqlplus -L
>> user/pass_at_service_name
>>
>> Instead use:
>> session1#printf "%s\n%s\n" "connect user/pass_at_service_name" "whenever
>> sqlerror exit failure" "select null from dual;"|sqlplus /nolog
>> >/dev/null 2>&1||echo "Database NOT accessible\!"
>>
>> session2#ps -ef|grep sqlplus
>> oracle 4815 29668 1 13:02:32 pts/2 0:01 sqlplus /nolog
>>
>>
>
> % ps -ef |grep printf |grep -v grep
> newmand 18505 9352 0 09:42 pts/1 00:00:00 printf %s\n%s\n connect
> user/pass_at_service_name whenever sqlerror exit failure select null from
> dual;
>
> It's probably best to put the SQL in its own script.
>
> --
> Dave Newman

... and for security reasons, make sure only the oracle owner has read access to the script ... Received on Tue Aug 29 2006 - 11:53:01 CDT

Original text of this message

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