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 in message
news:1105080949.900026.82730_at_f14g2000cwb.googlegroups.com...
> 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
>
#!/bin/ksh
sqlplus -sl "hr/XXXX" <<EOF
set feed off
set head off
set verify off
whenever sqlerror exit failure
WHENEVER OSERROR EXIT 13
select sysdate from dual;
exit
EOF
To turn off the output from connect statement, remove it.
Received on Fri Jan 07 2005 - 19:44:23 CST
![]() |
![]() |