Re: tnsping and sqlplus output OK, but [ORA-12545: Connect failed because target host or object does not exist]

  • From: Ron Crisco <ron.crisco@xxxxxxxxxxxx>
  • To: Ajeet.Ojha@xxxxxx
  • Date: Mon, 10 May 2010 08:50:20 -0500

You're attempting to connect twice, so the error is from the default connect
of sqlplus. Use sqplus -S /nolog in the command line to prevent this.

Ron Crisco

On Mon, May 10, 2010 at 8:37 AM, Ojha, Ajeet (GE Healthcare, consultant) <
Ajeet.Ojha@xxxxxx> wrote:

> Please check your TNSNAMES.ora  , this might have some problem , if you
> copy,paste the entries from another file to your tnsnames.ora , then
> this problem comes  - this is most common cause for this.
>
>
>
> -----Original Message-----
> From: oracle-l-bounce@xxxxxxxxxxxxx
> [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of Sven Aluoor
> Sent: Monday, May 10, 2010 6:58 PM
> To: oracle-l@xxxxxxxxxxxxx
> Subject: tnsping and sqlplus output OK, but [ORA-12545: Connect failed
> because target host or object does not exist]
>
> Hi folks
>
> I have here a strange problem. I wrote a lot of cronjobs with sqlplus
> here documents like that:
>
> select_script ()
> {
> db_dummy=Jby8a4xsS20Lf08aQ7Q7
> sqlplus -S <<EOF / > /opt/ess/scripts/outout_pf00.log
> essadmin/$db_dummy@$ORACLE_SID
> set echo Off
> set term On
> set pages 0
> set head off
> set ver off
> set feed off
> set trims on
> set linesize 200
>
> select * from rss;
>
> exit
> EOF
> }
>
> As output I receive in /opt/ess/scripts/outout_pf00.log the error
> "ORA-12545: Connect failed because target host or object does not
> exist" and the output of the Select-Query.
>
> Tnsping shows no error. Tnsnames.ora is OK (tried both IP-Address and
> name). Manual sqlplus with user name and password doesn't show the
> error.
>
> Everything works, but this is an ugly error message in the output. How
> to get rid of?
>
> cheers Sven
> --
> //www.freelists.org/webpage/oracle-l
>
>
> --
> //www.freelists.org/webpage/oracle-l
>
>
>

Other related posts: