dbTalk Databases Forums  

ERROR ORA-12154 TNS: could not resolve the connect identifierspecified

comp.databases.oracle.misc comp.databases.oracle.misc


Discuss ERROR ORA-12154 TNS: could not resolve the connect identifierspecified in the comp.databases.oracle.misc forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
beta
 
Posts: n/a

Default ERROR ORA-12154 TNS: could not resolve the connect identifierspecified - 10-13-2008 , 01:24 PM






Hi,

I have a strange problem with oracle connection. It gives a "ERROR
ORA-12154 TNS: could not resolve the connect identifier specified"
srror on the browser.

Here is my oraConnect.php ##############
<?php
$conn = OCILogon("hr", "hr", 'demo');
$query = 'select * from hr.jobs';

$stid = OCIParse($conn, $query);
OCIExecute($stid, OCI_DEFAULT);
while ($succ = OCIFetchInto($stid, $row)) {
foreach ($row as $item) {
echo $item." ";
}
echo "<br>\n";
}
?>

#### OUT put
# php oraConnect.php
AD_PRES President 20000 40000 <br>
AD_VP Administration Vice President 15000 30000 <br>
AD_ASST Administration Assistant 3000 6000 <br>
FI_MGR Finance Manager 8200 16000 <br>
FI_ACCOUNT Accountant 4200 9000 <br>
AC_MGR Accounting Manager 8200 16000 <br>
AC_ACCOUNT Public Accountant 4200 9000 <br>
SA_MAN Sales Manager 10000 20000 <br>

### TNSNAME / tnsping
# tnsping demo

TNS Ping Utility for Linux: Version 11.1.0.6.0 - Production on 13-
OCT-2008 11:20:30

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.xxxx.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)
(SERVICE_NAME = demo)))
OK (0 msec)

#### browser
http://localhost/oraConnect.php
Warning: ocilogon() [function.ocilogon]: ORA-12154: TNS:could not
resolve the connect identifier specified in /opt/www/oraConnect.php on
line 2

Warning: ociparse() expects parameter 1 to be resource, boolean given
in /opt/www/oraConnect.php on line 5

Warning: ociexecute() expects parameter 1 to be resource, null given
in /opt/www/oraConnect.php on line 6

Warning: ocifetchinto() expects parameter 1 to be resource, null given
in /opt/www/oraConnect.php on line 7


Thanks mycn,
Beta




Reply With Quote
  #2  
Old   
sybrandb@hccnet.nl
 
Posts: n/a

Default Re: ERROR ORA-12154 TNS: could not resolve the connect identifier specified - 10-14-2008 , 11:32 AM






On Mon, 13 Oct 2008 11:24:17 -0700 (PDT), beta <qlng2000 (AT) gmail (DOT) com>
wrote:

Quote:
Hi,

I have a strange problem with oracle connection. It gives a "ERROR
ORA-12154 TNS: could not resolve the connect identifier specified"
srror on the browser.

Here is my oraConnect.php ##############
?php
$conn = OCILogon("hr", "hr", 'demo');
$query = 'select * from hr.jobs';

$stid = OCIParse($conn, $query);
OCIExecute($stid, OCI_DEFAULT);
while ($succ = OCIFetchInto($stid, $row)) {
foreach ($row as $item) {
echo $item." ";
}
echo "<br>\n";
}
?

#### OUT put
# php oraConnect.php
AD_PRES President 20000 40000 <br
AD_VP Administration Vice President 15000 30000 <br
AD_ASST Administration Assistant 3000 6000 <br
FI_MGR Finance Manager 8200 16000 <br
FI_ACCOUNT Accountant 4200 9000 <br
AC_MGR Accounting Manager 8200 16000 <br
AC_ACCOUNT Public Accountant 4200 9000 <br
SA_MAN Sales Manager 10000 20000 <br

### TNSNAME / tnsping
# tnsping demo

TNS Ping Utility for Linux: Version 11.1.0.6.0 - Production on 13-
OCT-2008 11:20:30

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.xxxx.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)
(SERVICE_NAME = demo)))
OK (0 msec)

#### browser
http://localhost/oraConnect.php
Warning: ocilogon() [function.ocilogon]: ORA-12154: TNS:could not
resolve the connect identifier specified in /opt/www/oraConnect.php on
line 2

Warning: ociparse() expects parameter 1 to be resource, boolean given
in /opt/www/oraConnect.php on line 5

Warning: ociexecute() expects parameter 1 to be resource, null given
in /opt/www/oraConnect.php on line 6

Warning: ocifetchinto() expects parameter 1 to be resource, null given
in /opt/www/oraConnect.php on line 7


Thanks mycn,
Beta


Stupid questions maybe, but anyway questions about this error are
always redundant as there is a plethora of resources, just *because*
people don't do anything to resolve it themselves:

Is the webserver located on the database server?
Did you run tnsping on the webserver or on the database server?
Do you have one or multiple tnsnames.ora floating around?
Did you set the TNS_ADMIN enviroment variable?
Please note similar questions have been asked to other people with the
same problem, so I have one final question:
Why didn't you bother to search the documentation or forums.oracle.com
or Usenet. Assum ing you are unioue? Or just lazy?
Just wondering...

--
Sybrand Bakker
Senior Oracle DBA


Reply With Quote
  #3  
Old   
sybrandb@hccnet.nl
 
Posts: n/a

Default Re: ERROR ORA-12154 TNS: could not resolve the connect identifier specified - 10-14-2008 , 11:32 AM



On Mon, 13 Oct 2008 11:24:17 -0700 (PDT), beta <qlng2000 (AT) gmail (DOT) com>
wrote:

Quote:
Hi,

I have a strange problem with oracle connection. It gives a "ERROR
ORA-12154 TNS: could not resolve the connect identifier specified"
srror on the browser.

Here is my oraConnect.php ##############
?php
$conn = OCILogon("hr", "hr", 'demo');
$query = 'select * from hr.jobs';

$stid = OCIParse($conn, $query);
OCIExecute($stid, OCI_DEFAULT);
while ($succ = OCIFetchInto($stid, $row)) {
foreach ($row as $item) {
echo $item." ";
}
echo "<br>\n";
}
?

#### OUT put
# php oraConnect.php
AD_PRES President 20000 40000 <br
AD_VP Administration Vice President 15000 30000 <br
AD_ASST Administration Assistant 3000 6000 <br
FI_MGR Finance Manager 8200 16000 <br
FI_ACCOUNT Accountant 4200 9000 <br
AC_MGR Accounting Manager 8200 16000 <br
AC_ACCOUNT Public Accountant 4200 9000 <br
SA_MAN Sales Manager 10000 20000 <br

### TNSNAME / tnsping
# tnsping demo

TNS Ping Utility for Linux: Version 11.1.0.6.0 - Production on 13-
OCT-2008 11:20:30

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.xxxx.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)
(SERVICE_NAME = demo)))
OK (0 msec)

#### browser
http://localhost/oraConnect.php
Warning: ocilogon() [function.ocilogon]: ORA-12154: TNS:could not
resolve the connect identifier specified in /opt/www/oraConnect.php on
line 2

Warning: ociparse() expects parameter 1 to be resource, boolean given
in /opt/www/oraConnect.php on line 5

Warning: ociexecute() expects parameter 1 to be resource, null given
in /opt/www/oraConnect.php on line 6

Warning: ocifetchinto() expects parameter 1 to be resource, null given
in /opt/www/oraConnect.php on line 7


Thanks mycn,
Beta


Stupid questions maybe, but anyway questions about this error are
always redundant as there is a plethora of resources, just *because*
people don't do anything to resolve it themselves:

Is the webserver located on the database server?
Did you run tnsping on the webserver or on the database server?
Do you have one or multiple tnsnames.ora floating around?
Did you set the TNS_ADMIN enviroment variable?
Please note similar questions have been asked to other people with the
same problem, so I have one final question:
Why didn't you bother to search the documentation or forums.oracle.com
or Usenet. Assum ing you are unioue? Or just lazy?
Just wondering...

--
Sybrand Bakker
Senior Oracle DBA


Reply With Quote
  #4  
Old   
sybrandb@hccnet.nl
 
Posts: n/a

Default Re: ERROR ORA-12154 TNS: could not resolve the connect identifier specified - 10-14-2008 , 11:32 AM



On Mon, 13 Oct 2008 11:24:17 -0700 (PDT), beta <qlng2000 (AT) gmail (DOT) com>
wrote:

Quote:
Hi,

I have a strange problem with oracle connection. It gives a "ERROR
ORA-12154 TNS: could not resolve the connect identifier specified"
srror on the browser.

Here is my oraConnect.php ##############
?php
$conn = OCILogon("hr", "hr", 'demo');
$query = 'select * from hr.jobs';

$stid = OCIParse($conn, $query);
OCIExecute($stid, OCI_DEFAULT);
while ($succ = OCIFetchInto($stid, $row)) {
foreach ($row as $item) {
echo $item." ";
}
echo "<br>\n";
}
?

#### OUT put
# php oraConnect.php
AD_PRES President 20000 40000 <br
AD_VP Administration Vice President 15000 30000 <br
AD_ASST Administration Assistant 3000 6000 <br
FI_MGR Finance Manager 8200 16000 <br
FI_ACCOUNT Accountant 4200 9000 <br
AC_MGR Accounting Manager 8200 16000 <br
AC_ACCOUNT Public Accountant 4200 9000 <br
SA_MAN Sales Manager 10000 20000 <br

### TNSNAME / tnsping
# tnsping demo

TNS Ping Utility for Linux: Version 11.1.0.6.0 - Production on 13-
OCT-2008 11:20:30

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.xxxx.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)
(SERVICE_NAME = demo)))
OK (0 msec)

#### browser
http://localhost/oraConnect.php
Warning: ocilogon() [function.ocilogon]: ORA-12154: TNS:could not
resolve the connect identifier specified in /opt/www/oraConnect.php on
line 2

Warning: ociparse() expects parameter 1 to be resource, boolean given
in /opt/www/oraConnect.php on line 5

Warning: ociexecute() expects parameter 1 to be resource, null given
in /opt/www/oraConnect.php on line 6

Warning: ocifetchinto() expects parameter 1 to be resource, null given
in /opt/www/oraConnect.php on line 7


Thanks mycn,
Beta


Stupid questions maybe, but anyway questions about this error are
always redundant as there is a plethora of resources, just *because*
people don't do anything to resolve it themselves:

Is the webserver located on the database server?
Did you run tnsping on the webserver or on the database server?
Do you have one or multiple tnsnames.ora floating around?
Did you set the TNS_ADMIN enviroment variable?
Please note similar questions have been asked to other people with the
same problem, so I have one final question:
Why didn't you bother to search the documentation or forums.oracle.com
or Usenet. Assum ing you are unioue? Or just lazy?
Just wondering...

--
Sybrand Bakker
Senior Oracle DBA


Reply With Quote
  #5  
Old   
sybrandb@hccnet.nl
 
Posts: n/a

Default Re: ERROR ORA-12154 TNS: could not resolve the connect identifier specified - 10-14-2008 , 11:32 AM



On Mon, 13 Oct 2008 11:24:17 -0700 (PDT), beta <qlng2000 (AT) gmail (DOT) com>
wrote:

Quote:
Hi,

I have a strange problem with oracle connection. It gives a "ERROR
ORA-12154 TNS: could not resolve the connect identifier specified"
srror on the browser.

Here is my oraConnect.php ##############
?php
$conn = OCILogon("hr", "hr", 'demo');
$query = 'select * from hr.jobs';

$stid = OCIParse($conn, $query);
OCIExecute($stid, OCI_DEFAULT);
while ($succ = OCIFetchInto($stid, $row)) {
foreach ($row as $item) {
echo $item." ";
}
echo "<br>\n";
}
?

#### OUT put
# php oraConnect.php
AD_PRES President 20000 40000 <br
AD_VP Administration Vice President 15000 30000 <br
AD_ASST Administration Assistant 3000 6000 <br
FI_MGR Finance Manager 8200 16000 <br
FI_ACCOUNT Accountant 4200 9000 <br
AC_MGR Accounting Manager 8200 16000 <br
AC_ACCOUNT Public Accountant 4200 9000 <br
SA_MAN Sales Manager 10000 20000 <br

### TNSNAME / tnsping
# tnsping demo

TNS Ping Utility for Linux: Version 11.1.0.6.0 - Production on 13-
OCT-2008 11:20:30

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.xxxx.com)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED)
(SERVICE_NAME = demo)))
OK (0 msec)

#### browser
http://localhost/oraConnect.php
Warning: ocilogon() [function.ocilogon]: ORA-12154: TNS:could not
resolve the connect identifier specified in /opt/www/oraConnect.php on
line 2

Warning: ociparse() expects parameter 1 to be resource, boolean given
in /opt/www/oraConnect.php on line 5

Warning: ociexecute() expects parameter 1 to be resource, null given
in /opt/www/oraConnect.php on line 6

Warning: ocifetchinto() expects parameter 1 to be resource, null given
in /opt/www/oraConnect.php on line 7


Thanks mycn,
Beta


Stupid questions maybe, but anyway questions about this error are
always redundant as there is a plethora of resources, just *because*
people don't do anything to resolve it themselves:

Is the webserver located on the database server?
Did you run tnsping on the webserver or on the database server?
Do you have one or multiple tnsnames.ora floating around?
Did you set the TNS_ADMIN enviroment variable?
Please note similar questions have been asked to other people with the
same problem, so I have one final question:
Why didn't you bother to search the documentation or forums.oracle.com
or Usenet. Assum ing you are unioue? Or just lazy?
Just wondering...

--
Sybrand Bakker
Senior Oracle DBA


Reply With Quote
  #6  
Old   
gazzag
 
Posts: n/a

Default Re: ERROR ORA-12154 TNS: could not resolve the connect identifierspecified - 10-15-2008 , 11:22 AM



On 14 Oct, 17:32, sybra... (AT) hccnet (DOT) nl wrote:
Quote:
Stupid questions maybe, but anyway questions about this error are
always redundant as there is a plethora of resources, just *because*
people don't do anything to resolve it themselves:

Is the webserver located on the database server?
Did you run tnsping on the webserver or on the database server?
Do you have one or multiple tnsnames.ora floating around?
Did you set the TNS_ADMIN enviroment variable?
Please note similar questions have been asked to other people with the
same problem, so I have one final question:
Why didn't you bother to search the documentation or forums.oracle.com
or Usenet. Assum ing you are unioue? Or just lazy?
Just wondering...

--
Sybrand Bakker
Senior Oracle DBA- Hide quoted text -

What Sybrand's saying here is that you are not as unique as you think
you are. _Somebody_ would have had the same problem as you somewhere
at some point. Did you try searching the archives for ORA-12154?

HTH

-g


Reply With Quote
  #7  
Old   
gazzag
 
Posts: n/a

Default Re: ERROR ORA-12154 TNS: could not resolve the connect identifierspecified - 10-15-2008 , 11:22 AM



On 14 Oct, 17:32, sybra... (AT) hccnet (DOT) nl wrote:
Quote:
Stupid questions maybe, but anyway questions about this error are
always redundant as there is a plethora of resources, just *because*
people don't do anything to resolve it themselves:

Is the webserver located on the database server?
Did you run tnsping on the webserver or on the database server?
Do you have one or multiple tnsnames.ora floating around?
Did you set the TNS_ADMIN enviroment variable?
Please note similar questions have been asked to other people with the
same problem, so I have one final question:
Why didn't you bother to search the documentation or forums.oracle.com
or Usenet. Assum ing you are unioue? Or just lazy?
Just wondering...

--
Sybrand Bakker
Senior Oracle DBA- Hide quoted text -

What Sybrand's saying here is that you are not as unique as you think
you are. _Somebody_ would have had the same problem as you somewhere
at some point. Did you try searching the archives for ORA-12154?

HTH

-g


Reply With Quote
  #8  
Old   
gazzag
 
Posts: n/a

Default Re: ERROR ORA-12154 TNS: could not resolve the connect identifierspecified - 10-15-2008 , 11:22 AM



On 14 Oct, 17:32, sybra... (AT) hccnet (DOT) nl wrote:
Quote:
Stupid questions maybe, but anyway questions about this error are
always redundant as there is a plethora of resources, just *because*
people don't do anything to resolve it themselves:

Is the webserver located on the database server?
Did you run tnsping on the webserver or on the database server?
Do you have one or multiple tnsnames.ora floating around?
Did you set the TNS_ADMIN enviroment variable?
Please note similar questions have been asked to other people with the
same problem, so I have one final question:
Why didn't you bother to search the documentation or forums.oracle.com
or Usenet. Assum ing you are unioue? Or just lazy?
Just wondering...

--
Sybrand Bakker
Senior Oracle DBA- Hide quoted text -

What Sybrand's saying here is that you are not as unique as you think
you are. _Somebody_ would have had the same problem as you somewhere
at some point. Did you try searching the archives for ORA-12154?

HTH

-g


Reply With Quote
  #9  
Old   
gazzag
 
Posts: n/a

Default Re: ERROR ORA-12154 TNS: could not resolve the connect identifierspecified - 10-15-2008 , 11:22 AM



On 14 Oct, 17:32, sybra... (AT) hccnet (DOT) nl wrote:
Quote:
Stupid questions maybe, but anyway questions about this error are
always redundant as there is a plethora of resources, just *because*
people don't do anything to resolve it themselves:

Is the webserver located on the database server?
Did you run tnsping on the webserver or on the database server?
Do you have one or multiple tnsnames.ora floating around?
Did you set the TNS_ADMIN enviroment variable?
Please note similar questions have been asked to other people with the
same problem, so I have one final question:
Why didn't you bother to search the documentation or forums.oracle.com
or Usenet. Assum ing you are unioue? Or just lazy?
Just wondering...

--
Sybrand Bakker
Senior Oracle DBA- Hide quoted text -

What Sybrand's saying here is that you are not as unique as you think
you are. _Somebody_ would have had the same problem as you somewhere
at some point. Did you try searching the archives for ORA-12154?

HTH

-g


Reply With Quote
  #10  
Old   
beta
 
Posts: n/a

Default Re: ERROR ORA-12154 TNS: could not resolve the connect identifierspecified - 10-15-2008 , 11:46 AM



Thanks guys,

I've searched forums.oracle.com and all other places, but still no
luck. The ORA-12154 error message is very general. I am very
appreciated if you have any clues.


On Oct 15, 9:22*am, gazzag <gar... (AT) jamms (DOT) org> wrote:
Quote:
On 14 Oct, 17:32, sybra... (AT) hccnet (DOT) nl wrote:





Stupid questions maybe, but anyway questions about this error are
always redundant as there is a plethora of resources, just *because*
people don't do anything to resolve it themselves:

Is the webserver located on the database server?
Did you run tnsping on the webserver or on the database server?
Do you have one or multiple tnsnames.ora floating around?
Did you set the TNS_ADMIN enviroment variable?
Please note similar questions have been asked to other people with the
same problem, so I have one final question:
Why didn't you bother to search the documentation or forums.oracle.com
or Usenet. Assum ing you are unioue? Or just lazy?
Just wondering...

--
Sybrand Bakker
Senior Oracle DBA- Hide quoted text -

What Sybrand's saying here is that you are not as unique as you think
you are. *_Somebody_ would have had the same problem as you somewhere
at some point. *Did you try searching the archives for ORA-12154?

HTH

-g


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.