Hello!
I have an intersting problem that I cant seem to be able to solve. Ive tested about all I can think of so I hope you can come up with what I have missed.
What do I want to do:
Connect from php to an oracle database. This is running on a rac consisting of 3 nodes.
Pretty straight forward i would have imagined with just a slight change in tnsnames.ora really. Well, it wasnt (at least not for me).
Background:
All machines are linuxes of various flavours. The rac machines are running RH AS 2.1 (they are connected to a emc clariion 600 san). The webserver machine is a gentoo machine (but ive tested on many others). Phpversion is 4.3.4 and it is compiled with --with-oci8=/correctpathtooracle. The phpcode im using looks like this:
<html>
<body>
<?php
putenv("ORACLE_HOME=/mnt/oracle/product/9.2.0");
putenv("ORACLE_SID=RAC");
$conn = OCILogon("budxxxx", "bapxxxx", "RAC");
$stmt = ociparse($conn,"SELECT * FROM KONTO");
ociexecute($stmt);
print("<p>----selecting</p>\n");
for($i = 0; ocifetch($stmt); $i++){
print("<p>".$i.": ".ociresult($stmt, "KONTO")."</p>\n");
}
print("<p>----done</p>\n");
OCIFreeStatement($stmt);
OCILogoff($conn);
?>
</body>
</html>
Nothing special really.
The error i get most of the time is:
Warning: ociexecute(): OCIStmtExecute: ORA-16710: the resource guard is out of memory in /home/fjutt/public_html/oracle/try.php on line 18
Checking on metalink didnt help.
Ive tried putting all kinds of env variables to no help. After a while i started doubting the RAC was doing ok so i wrote some test scripts. One in java, one in perl and on using sqlplus all doing exactly the same thing the php is trying to do (and running on the same machine as the web server). All 3 worked as expected with no problems at all...
This makes me pretty certain the listeners, tnsnames.ora and so on are correctly set up and that this is an phpproblem.
I really have no idea what to test next, so any ideas at all are very very helpful.
Oh, and the database is 9.2.0.4 on all places (ie the client side and the rac).
Anyone ever run php against a RAC database working the way it should?
Thanks a lot in advance.