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

Home -> Community -> Usenet -> c.d.o.misc -> Re: shell script and validating userid/password

Re: shell script and validating userid/password

From: Connor McDonald <connor_mcdonald_at_yahoo.com>
Date: Wed, 21 Jul 1999 21:26:47 +0800
Message-ID: <3795CA97.1CCF@yahoo.com>


Jenny Farnham wrote:
>
> Howdy Gurus,
>
> We have a bourne shell script that we will be
> having a System Admin type in the username/password
> and connect string.
>
> Example: run_shell_script jingle/claus_at_northpole_xya
>
> In this shell script we are executing a sql*plus script.
>
> Here's the scenario/proplem.
>
> If the System Admin types in a wrong userid/password/dblink
> connect string, then when the sqlplus tries to use it,
> it just hangs and the shell script hangs.
>
> What is the best way to validate the connect string?
> or
> Is there a way to get sql*plus to auto exit out if the
> connect string is invalid?
>
> We are NOT going to use the option of the "/" for many reasons.
> (Example: sqlplus /).
>
> Thanks for any insight -----------------------------------------

You could connect as a known account and then reconnect and include the 'whenever' clause to bomb out if the connection is wrong...

Example script:

#!/bin/sh
sqlplus knowuser/knownpassword <<EOF
whenever ... error
conn $1
select ..
from ...
etc etc
exit
EOF --



Connor McDonald
"These views mine, no-one elses etc etc" connor_mcdonald_at_yahoo.com

"Some days you're the pigeon, and some days you're the statue." Received on Wed Jul 21 1999 - 08:26:47 CDT

Original text of this message

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