The message error occurred at recursive SQL level 1
suggests to me that the error is arising within a trigger. My guess is that there is an AFTER LOGON ON SCHEMA
or DATABASE
trigger, and for some reason it causes an error when your web server process attempts to connect.
Here's an example of how to generate the error you're getting. I have a table called TINY
, with a single column that can only take values up to 99:
SQL> desc tiny;
Name Null? Type
----------------------------------------- -------- ----------------------------
N NUMBER(2)
Now let's create a user account and verify that they can connect:
SQL> create user fred identified by fred account unlock;
User created.
SQL> grant connect to fred;
Grant succeeded.
SQL> connect fred/fred
Connected.
Good - let's log back in as me and create a trigger that will cause an error if FRED
attempts to connect:
SQL> connect luke/password
Connected.
SQL> create or replace trigger after_logon_error_if_fred
2 after logon on database
3 begin
4 if user = 'FRED' then
5 insert into tiny (n) values (100);
6 end if;
7 end;
8 /
Trigger created.
Recall that our TINY
table can only store values up to 99. So, what happens when FRED
attempts to connect?
SQL> connect fred/fred
ERROR:
ORA-00604: error occurred at recursive SQL level 1
ORA-01438: value larger than specified precision allowed for this column
ORA-06512: at line 3
Other than the line number, and the bit PHP added, that's exactly the message you got.
If you want to see whether there are any AFTER LOGON
triggers in your database, try running the query
SELECT trigger_name, owner FROM all_triggers
WHERE TRIM(triggering_event) = 'LOGON';
On my database (Oracle 11g XE beta), I get the following output:
TRIGGER_NAME OWNER
------------------------------ ------------------------------
AFTER_LOGON_ERROR_IF_FRED LUKE
I don't believe Oracle does any logging out-of-the-box, and I'd be surprised if PHP's oci_connect
does either.
I can only speculate as to why the error arises only for your web server and not when you run PHP from a bash script. Perhaps the trigger is querying V$SESSION
and trying to figure out what user account is trying to connect to the database?