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



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



.



Relevant Pages

  • Re: Networking problem (addl info)
    ... Did 'ping' resolve the hostname? ... What browser are you ... not running in a virtual machine ...
    (comp.os.linux.setup)
  • Re: BIND update?
    ... ask to resolve www.google.com, the answer does not mean "www.google.com is on the network at 74.125.19.104." ... Yes, yes, DNS makes no security guarantees, it's always been vulnerable, this is old old news. ... what's at issue is that you're choosing to let unknown and untrusted sites inject arbitrary data into your web browser. ... check old CERT advisories, attackers have been exploiting DNS cache vulnerabilities in home/soho routers/WAPs/firewalls for a while now. ...
    (FreeBSD-Security)
  • Re: Page Display Error
    ... > worked deleting my profile as suggested in Support document 303807. ... Glad to hear you were able to resolve your problem. ... >> Make sure Windows is set to show hidden files and folders and is NOT set ...
    (microsoft.public.windows.inetexplorer.ie6.browser)
  • Re: Dimension processing TNS Names do Not Resolve
    ... Great suggestion by Christophe - helped me with a completely different issue! ... I believe the issue had to do with the location of my TNS ... Oracle 9.1 ... TNS:could not resolve service name ...
    (microsoft.public.sqlserver.olap)
  • Re: Dimension processing TNS Names do Not Resolve
    ... I believe the issue had to do with the location of my TNS ... Oracle 9.1 ... TNS:could not resolve service name ... DSV does show the table underneath on the Oracle server, ...
    (microsoft.public.sqlserver.olap)