Re: What stupid mistake am I making with this onlogin trigger?
Date: Tue, 26 Feb 2008 12:16:12 +0100
code addings inline
> After going back an forth on this for a while today I figured a few more sets of eyes couldn't hurt.
> I need to track connections from a specific module (not SQL*Plus but that was easiest for testing purposes). This trigger compiles but does not create any rows. The insert statement works if run from a sql*plus prompt. I'm sure I'm missing something really obvious here...
> Does the onlogin trigger possibly execute as the user logging in as opposed to as sys?
> Trigger created:
> SQL> create or replace trigger sys.trace_php_onlogin after logon on database
insert into wsidba.php_logins
from sys.v_$session where sid = (select unique(sid) from v$mystat) and upper(module) like '%SQL%';commit;
WHEN OTHERS THEN
- must close the autonomous transaction to get the correct error message outside
> Trigger created.
> Doesn't enter any data to table:
> usnjc01urp001:/services/home/oracle<lass> $ sqlplus wsidba
> Jay Miller
kfReceived on Tue Feb 26 2008 - 05:16:12 CST