Re: ERROR ORA-12154 TNS: could not resolve the connect identifier specified

From: joel garry <joel-garry_at_home.com>
Date: Thu, 16 Oct 2008 16:48:25 -0700 (PDT)
Message-ID: <c23ae6f3-d9ad-45ed-bb5d-41f8d6fe6fb6@s1g2000prg.googlegroups.com>


On Oct 16, 2:36 pm, beta <qlng2..._at_gmail.com> wrote:
> On Oct 16, 11:31 am, Frank van Bortel <frank.van.bor..._at_gmail.com>
> wrote:
>
>
>
>
>
> > beta wrote:
> > > I am a developer consultant ! it is a serious issue for me.
> > > The error message (ORA-12154: TNS:could not resolve the connect
> > > identifier specified) like the environment is not correct setup for a
> > > web. What I've done was create a new startup web sript
>
> > > *****************************
> > > #/bin/sh
> > > export ORACLE_BASE=/opt/app/oracle
> > > export ORACLE_HOME=/opt/app/oracle/product/11.1.0/db_1
> > > export ORACLE_SID=demo
> > > export LD_LIBRARY_PATH=/opt/app/oracle/product/11.1.0/db_1/lib
> > > export TNS_ADMIN=/opt/app/oracle/product/11.1.0/db_1/network/admin
>
> > Odd... you tnsping uses
> > /u01/app/oracle/product/11.1.0/db_1/network/admin/
> > --
>
> > Regards,
> > Frank van Bortel
>
> Hi Frank,
> Here is tnsping output
> ### tnsping demo
> TNS Ping Utility for Linux: Version 11.1.0.6.0 - Production on 16-
> OCT-2008 14:28:29
> Copyright (c) 1997, 2007, Oracle.  All rights reserved.
> Used parameter files:
> /u01/app/oracle/product/11.1.0/db_1/network/admin/sqlnet.ora
> Used TNSNAMES adapter to resolve the alias
> Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST
> = xxx.xxx.xxx.13)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)
> (SERVICE_NAME = DEMO)))
> OK (0 msec)
>
> Does something worng with my tns location or else?
>
> Everything works fine with me, if I change y program like
>
> <?php
>        $dbsrt="(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST =www.www.com)(PORT= 1521))(CONNECT_DATA =(SERVER = DEDICATED)
> (SERVICE_NAME = demo)))";
>
>        $connection = oci_connect("hr", "hr",$dbsrt);
>        ....
>        ...
> ?>
>
> I like to replace the "$dbsrt" with 'demo" in oci_connect() function.
> Do you see what a problem on my tnsnames.ora?
>
> Thanks much,

Try lower case demo in the tnsnames.ora, try double quotes in the login where you have single quotes.

A wild guess, but it has been known to be a problem in some configurations.

What does lsnrctl status say? Maybe you have to add something to the login string like viet.cuenot.mendelbio.com .

Could there be a problem with the web environment not knowing about the tnsnames.ora?

jg

--
@home.com is bogus.
Sorry Sybrand, Oracle indeed now sells crystal balls:
http://oraclestore.oracle.com/OA_HTML/ibeCCtpSctDspRte.jsp?section=131706&sitex=10021:22372:US
Received on Thu Oct 16 2008 - 18:48:25 CDT

Original text of this message