Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: NOWAIT exit from sqlplus when ORA-12545
mso wrote:
> Hi
> (it's for: Windows NT/XP and Oracle 8.1.7.4)
> --
> J have a problem when J run test.bat such as :
> sqlplus infolig/edfinfo_at_POR1_SPARE @my_file.sql
> if %errorlevel% NEQ 0 echo KO: %ERRORLEVEL% else echo OK
> %ERRORLEVEL%
> --
> When my POR1_SPARE server is not accessible/not connected the test.bat
> is waiting with ORA-12545.
> --------------------------------------------------------------------------------------------------------------------------------
>
> D:\IL\BD_IL5\EvoPrisme\Upgrade>sqlplus infolig/edfinfo_at_POR1_SPARE
> @my_file.sql
>
> SQL*Plus: Release 8.1.7.0.0 - Production on Ve Aou 18 15:16:31 2006
>
> (c) Copyright 2000 Oracle Corporation. All rights reserved.
>
> ERROR:
> ORA-12545: Connexion impossible car l'h¶te ou l'objet cible n'existe
> pas
>
>
> Entrez le nom utilisateur :
> --------------------------------------------------------------------------------------------------------------------------------
> Would it be possible to avoid it and exit the sqlplus immediately (is
> it any SqlNet parameter) ?
>
> Thanks a lot
>
> mso
You could use tnsping or ping for a servercheck and then evaluate %errorlevel%.
If you want to use SQLPLUS then you can use the /nolog switch and do
the connect in
the sql Script. Maybe you could build some error Handling with the
spool command
and a dos FIND.
regards
s.kapitza Received on Fri Aug 18 2006 - 15:24:25 CDT