-
PHP and ORA-03120
I have a PHP script that runs from my webserver. The script is being run as a
CGI script. This script connects to the database using OCI, retrieves 3
records from a one column table, and then disconnects.
db1.us and db2.us are hosted on the same Solaris box. Both dbs have the same
$ORACLE_HOME. I created the same user and same table on both databases.
When the script connects to db1.us, no problem, it retrieves the data and
displays it like I want. When the script runs against db2.us, it connects to
the database and gets a "ORA-03120: two-task conversion routine: integer
overflow" error.
Obviously, something is different between the two dbs, but I don't have a clue of what to look for.
PHP Code:
<html>
<p>Oracle DB Test</p>
<?php
Putenv("ORACLE_HOME=/usr/local/oracle");
$db=OCILogon("jeffh","jeffh", "db1.us");
if ( $db == false ) {
$err = OCIError();
$err_code = $err['code'];
$err_message = $err['message'];
echo $err_code;
echo $err_message;
echo <<<ERROR_MESSAGE
<table border="1" cellpadding="0" cellspacing="0" bordercolor="red">
<tr>
<th colspan="2">The Following Error Has Occured!</th>
</tr>
<tr>
<th>Code</th>
<th>Message</th>
</tr>
<tr>
<td>$err_code</td>
<td>$err_message</td>
</tr>
</table>
ERROR_MESSAGE;
exit;
}
$sql="select x from xyz";
$cur = OCIParse($db, $sql);
if (OCIError() != false ) {
$err = OCIError();
$err_code = $err['code'];
$err_message = $err['message'];
echo <<<ERROR_MESSAGE
<table border="1" cellpadding="0" cellspacing="0" bordercolor="red">
<tr>
<th colspan="2">The Following Error Has Occured!</th>
</tr>
<tr>
<th>Code</th>
<th>Message</th>
</tr>
<tr>
<td>$err_code</td>
<td>$err_message</td>
</tr>
</table>
ERROR_MESSAGE;
exit;
}
$res = OCIExecute($cur);
if ($res == false ) {
echo "error executing...";
$err = OCIError($cur);
$err_code = $err['code'];
$err_message = $err['message'];
echo <<<ERROR_MESSAGE
<table border="1" cellpadding="0" cellspacing="0" bordercolor="red">
<tr>
<th colspan="2">The Following Error Has Occured!</th>
</tr>
<tr>
<th>Code</th>
<th>Message</th>
</tr>
<tr>
<td>$err_code</td>
<td>$err_message</td>
</tr>
</table>
ERROR_MESSAGE;
exit;
}
echo "<table border=1>";
echo "<tr><td><b>name</b></td></tr>";
while (OCIFetchInto($cur, $values)) {
echo "<tr><td><b>$values[0]</b></td></tr>";
}
echo "</table>";
OCILogoff($db);
?>
</html>
Jeff Hunter
-
This is just a guess but have you thought about unsetting two_task?
You don't need to use TWO_TASK to connect to a database.
I have seen issues with TWO_TASK and running shell scripts,
which may or may not relate to your issue.
-
-
I'm sure you have already looked up the ORA-03120 error, but are you retrieving more than 32k of data from the database causing the TWO_TASK error?
Have you tried setting TWO_TASK?
-
Originally posted by gandolf989
I'm sure you have already looked up the ORA-03120 error, but are you retrieving more than 32k of data from the database causing the TWO_TASK error?
Have you tried setting TWO_TASK?
I'm only retrieving about 40 bytes of data. I have tried all sorts of incarnations of TWO_TASK without luck.
Jeff Hunter
-
This might be nitpicking but you have the same error message three times in your code without identifiying exactly where the error is happening.
Rather than using a generic message like this:
The Following Error Has Occured!
Try more specific error messages like these:
Unable to log on due to error:
Error parsing query:
Error executing query:
This might be as simple as a lack of permissions.
Last edited by gandolf989; 11-10-2004 at 02:50 PM.
-
This is just a simplified example.
Jeff Hunter
-
If i'm not mistaken Jeff,
it is the external procedure that is not properly
configured in your SID_LIST_LISTENER in LISTENER.
usually an OCI program uses the extproc program,
which is also found in the ORACLE_HOME dir where in the db resides.
In your case, i think there must be a separate SID_DESC, since you have two database.
I hope i'm right, and that it can help.
-
Originally posted by reydp
If i'm not mistaken Jeff,
it is the external procedure that is not properly
configured in your SID_LIST_LISTENER in LISTENER.
usually an OCI program uses the extproc program,
which is also found in the ORACLE_HOME dir where in the db resides.
In your case, i think there must be a separate SID_DESC, since you have two database.
I hope i'm right, and that it can help.
My webserver is a different host than my dbserver. I am not trying to call PHP from Oracle, but trying to get results back from Oracle to PHP.
Jeff Hunter
-
I tracked this down to a NLS Character Set issue. On databases setup with US7ASCII as their character set, the PHP script works fine. On databases with the character set WE8ISO8859P1, the ORA-03120 was produced. I cloned the subject database and changed the character set to US7ASCII and the PHP works fine now.
Jeff Hunter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|