Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: number of attemps login via sqlplus
my888_at_telstra.com wrote:
> Guys,
> I have shell script as follows:
> -------------------------------------------------
> #!/bin/sh
> sqlplus -s user/pass_at_sid @my_sql
>
> echo $OK
>
> -------------------------------------------------
>
> The script works fine if the DB instance sid is up and running,
> otherwise, it will sit at the sqlplus line forever. Ofcourse, I can
> re-write the script to do some error handling. Is there a switch to
> tell sqlplus to try login once??
>
> The other solution is:
>
> -------------------------------------------------------
> #!/bin/sh
> sqlplus -s /nolog <<EOF
> set feed off
> set head off
> set verify off
> whenever sqlerror exit failure
> WHENEVER OSERROR EXIT 13
>
> connect user/pass_at_sid
> select sysdate from dual;
> exit
> EOF
>
>
> --------------------------------------------------------
> OUTPUT--->
>
> Connected.
>
> 07-JAN-05
>
>
>
>
> This solution is 99.99% OK, however, I cannot turn off the output
from
> the connect statement. Does anyone know how to turn if off????
> Thank you!!
>
>
> Ted
If you are on 9i and above, you can use -L switch to attempt only one login. sqlplus -l -s ....
OR
set termout off
OR
$ print exit|sqlplus user/pass_at_db @blah >/dev/null 2>&1
Regards
/Rauf
Received on Fri Jan 07 2005 - 04:02:09 CST
![]() |
![]() |