I meet problem with ORA-12154: TNS:could not resolve service name error and managed to solve it by using full SID info instead just SID ID.
But now, I get ORA-12699: Native service internal error. I have no problems accessing Oracle server by SQL Plus or Delphi.
I use PHP 4.0.4 and Oracle 8i for Windows. Can anyone helkp me sole this problem?
Code that gives me headdache is:
<?
$conn = OCILogon("sonja","info","(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = NST)(PORT = 1521)) ) (CONNECT_DATA = (SID = PG02)))");
?>
Login to Oracle server help needed
Moderator: General Moderators
Hi,
You shouldn't have to use the full SID in the connect function.
Can you TNSPING the database from the command line?
Does your tnsnames.ora file have the correct entry?
Is PHP, Oracle Client, Oracle Server and Delphi all on the same machine?
Do you only have 8i client installed, or was 7.x installed previously on that machine?
Mike
You shouldn't have to use the full SID in the connect function.
Can you TNSPING the database from the command line?
Does your tnsnames.ora file have the correct entry?
Is PHP, Oracle Client, Oracle Server and Delphi all on the same machine?
Do you only have 8i client installed, or was 7.x installed previously on that machine?
Mike
Here's the kind of thing I usually use:
$user="username";
$pass="password";
$string = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.1)(PORT=6813))(CONNECT_DATA=(SID=SHOP)))";
$OC = OCILogon($user,$pass,$string);
Also, is it an Oracle 8 server you're accessing or lower?
btw:
ORA-12699: Native service internal error
Cause: An internal error occurred in the native services component.
Action: Enable tracing to determine the exact error. Contact Worldwide Customer Support.
$user="username";
$pass="password";
$string = "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.1)(PORT=6813))(CONNECT_DATA=(SID=SHOP)))";
$OC = OCILogon($user,$pass,$string);
Also, is it an Oracle 8 server you're accessing or lower?
btw:
ORA-12699: Native service internal error
Cause: An internal error occurred in the native services component.
Action: Enable tracing to determine the exact error. Contact Worldwide Customer Support.
Mike, I have to use full SID, there is some bug in widnows version of oci8 support, and it cannot read it form tnsnames.ora. I have Oracle 8i server installed on remote machine and my machine has Windows 2000, Oracle 8i client and Delphi. This is where I am trying to run PHP to connect Oracle server. I do not use web server but execute scripts from command prompt (i.e. php.exe script.php). There was no previous version of Oracle client here.
I have found some information about this problem and managed to avoid "ORA-12154: TNS:could not resolve service name error" and even "ORA-12699: Native service internal error" but now another one popped up: "ORA-12203: TNS:unable to connect to destination". Still, everything works when I use SQL Plus or Delphi.
Here is the code:
<?
PutEnv("ORACLE_HOME=c:\orant\ora80");
PutEnv("ORACLE_BASE=c:\orant");
PutEnv("ORACLE_SID=PG02.WORLD");
PutEnv("LD_LIBRARY_PATH=c:\orant\ora80\bin");
PutEnv("TNS_ADMIN=c:\orant\net80\admin");
PutEnv("TWO_TASK=c:\orant\net80\admin\tnsnames.ora");
$conn = OCILogon("sonja","info","(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.10.11)(PORT = 1521)) ) (CONNECT_DATA = (SID = PG02)))");
?>
As far as I can see, lots of people are dealing with the same problem for years, mostly without success.
I have found some information about this problem and managed to avoid "ORA-12154: TNS:could not resolve service name error" and even "ORA-12699: Native service internal error" but now another one popped up: "ORA-12203: TNS:unable to connect to destination". Still, everything works when I use SQL Plus or Delphi.
Here is the code:
<?
PutEnv("ORACLE_HOME=c:\orant\ora80");
PutEnv("ORACLE_BASE=c:\orant");
PutEnv("ORACLE_SID=PG02.WORLD");
PutEnv("LD_LIBRARY_PATH=c:\orant\ora80\bin");
PutEnv("TNS_ADMIN=c:\orant\net80\admin");
PutEnv("TWO_TASK=c:\orant\net80\admin\tnsnames.ora");
$conn = OCILogon("sonja","info","(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.10.11)(PORT = 1521)) ) (CONNECT_DATA = (SID = PG02)))");
?>
As far as I can see, lots of people are dealing with the same problem for years, mostly without success.
Hi,
I happily have a server with PHP talking to a remote Oracle database, I only use the SID
e.g. OCILogon('blah','blah','SID');
I'm using the oci8 on windows without any errors, another thing to note is that I don't have to include any of those lines you have at the start
PutEnv("ORACLE_HOME=c:\orant\ora80");
PutEnv("ORACLE_BASE=c:\orant");
PutEnv("ORACLE_SID=PG02.WORLD");
PutEnv("LD_LIBRARY_PATH=c:\orant\ora80\bin");
PutEnv("TNS_ADMIN=c:\orant\net80\admin");
PutEnv("TWO_TASK=c:\orant\net80\admin\tnsnames.ora");
and it looks from this to be default install.
I didn't do any special configuration, just an out-the-box install of oracle client, uncommented the relevant extension in php.ini.
Have you tried it without any of the PutEnv stuff?
Mike
I happily have a server with PHP talking to a remote Oracle database, I only use the SID
e.g. OCILogon('blah','blah','SID');
I'm using the oci8 on windows without any errors, another thing to note is that I don't have to include any of those lines you have at the start
PutEnv("ORACLE_HOME=c:\orant\ora80");
PutEnv("ORACLE_BASE=c:\orant");
PutEnv("ORACLE_SID=PG02.WORLD");
PutEnv("LD_LIBRARY_PATH=c:\orant\ora80\bin");
PutEnv("TNS_ADMIN=c:\orant\net80\admin");
PutEnv("TWO_TASK=c:\orant\net80\admin\tnsnames.ora");
and it looks from this to be default install.
I didn't do any special configuration, just an out-the-box install of oracle client, uncommented the relevant extension in php.ini.
Have you tried it without any of the PutEnv stuff?
Mike
f course I did, I started that way but it was not working at all, then i started looking for help through net ant this is best I managed.
It seems there are two kind of usres of php/OCI8, ones who have no problems using it liek you, and ones who cannot make it work at all, like me. We have one comon thing, everything is installed in the same way by all of us.
It seems there are two kind of usres of php/OCI8, ones who have no problems using it liek you, and ones who cannot make it work at all, like me. We have one comon thing, everything is installed in the same way by all of us.