ERROR ORA-12154 TNS: could not resolve the connect identifier specified
- From: beta <qlng2000@xxxxxxxxx>
- Date: Mon, 13 Oct 2008 11:24:17 -0700 (PDT)
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
.
- Follow-Ups:
- Re: ERROR ORA-12154 TNS: could not resolve the connect identifier specified
- From: "Álvaro G. Vicario"
- Re: ERROR ORA-12154 TNS: could not resolve the connect identifier specified
- From: sybrandb
- Re: ERROR ORA-12154 TNS: could not resolve the connect identifier specified
- Prev by Date: Re: comparing a DATE column with "one minute ago", type warning?
- Next by Date: Re: Partial Index Usage Performance Question
- Previous by thread: Download Free Oracle 11g, 10g, 9i eBooks, Mock Tests, Interview, Guides etc
- Next by thread: Re: ERROR ORA-12154 TNS: could not resolve the connect identifier specified
- Index(es):
Relevant Pages
|