Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: shell script and validating userid/password
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
--
"Some days you're the pigeon, and some days you're the statue." Received on Wed Jul 21 1999 - 08:26:47 CDT
![]() |
![]() |