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

From: beta <qlng2000_at_gmail.com>
Date: Thu, 16 Oct 2008 14:36:56 -0700 (PDT)
Message-ID: <4734bfe2-7fa6-49d5-8c1e-ba48bcb5aa64@i18g2000prf.googlegroups.com>


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, Received on Thu Oct 16 2008 - 16:36:56 CDT

Original text of this message