Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> Logon Trigger and Cursors
I've come across a situation that I am at a loss to explain. (and no
medical catastrophe analogies here).
I have a logon trigger to capture session information (poor man's audit). In the 10046 trace file, I see the cursors assoctiated with the trigger, but they do not produce STAT lines. I assume the cursor is closed, because the handle is reused. When I execute the trigger body by itself, I get STAT lines. When I execute a DML trigger, I get STAT lines.
The 'rule' I've operated with is that STAT lines are emitted when the cursor is closed. Is there an exception to this rule, something I don't know or perhaps a bug?
The 10046 output is below (some info snipped). The database is 9.2.0.3/64-bit on Solaris9.
Regards,
Daniel Fink
#1 - Logon Trigger
v_session_id number; v_osuser varchar2(64); v_machine varchar2(64); v_program varchar2(64);
select sid into v_session_id from sys.v$mystat where rownum = 1; select osuser, machine, program into v_osuser, v_machine, v_program from sys.v$session where sid = v_session_id; insert into user_connections (os_username, user_machine, user_program) values (v_osuser, v_machine, v_program);end if;
from sys.v$session where sid = :b1
(os_username, user_machine, user_program) values (:b3, :b2, :b1)
PARSING IN CURSOR #3 len=22 dep=0 uid=34 oct=3 lid=34 tim=3524087998886
hv=4119976668 ad='bceed600'
SELECT USER FROM DUAL
END OF STMT
STAT #3 id=1 cnt=1 pid=0 pos=1 obj=195 op='TABLE ACCESS FULL DUAL (cr=3
r=0 w=0 time=65 us)'
RENCY', 'NLS_DATE_LANGUAGE','NLS_NUMERIC_CHARACTERS','NLS_LANGUAGE','NLS_TERRITORY'
STAT #3 id=1 cnt=7 pid=0 pos=1 obj=76 op='FIXED TABLE FULL X$NLS_PARAMETERS (cr=0 r=0 w=0 time=168 us)'
v_session_id number; v_osuser varchar2(64); v_machine varchar2(64); v_program varchar2(64);
select sid into v_session_id from sys.v$mystat where rownum = 1;
select osuser, machine, program
into v_osuser, v_machine, v_program
from sys.v$session
where sid = v_session_id;
insert into user_connections
(os_username, user_machine, user_program)
values
(v_osuser, v_machine, v_program);
end if;
end;
END OF STMT
from sys.v$session
where sid = :b1
END OF STMT
(os_username, user_machine, user_program)
values
(:b3, :b2, :b1)
END OF STMT
STAT #3 id=1 cnt=1 pid=0 pos=1 obj=0 op='COUNT STOPKEY (cr=0 r=0 w=0
time=67 us)'
STAT #3 id=2 cnt=1 pid=1 pos=1 obj=0 op='FILTER (cr=0 r=0 w=0 time=61 us)'
STAT #3 id=3 cnt=1 pid=2 pos=1 obj=26 op='FIXED TABLE FULL X$KSUMYSTA
(cr=0 r=0 w=0 time=43 us)'
STAT #3 id=4 cnt=1 pid=2 pos=2 obj=24 op='FIXED TABLE FULL X$KSUSGIF
(cr=0 r=0 w=0 time=3 us)'
STAT #4 id=1 cnt=1 pid=0 pos=1 obj=16 op='FIXED TABLE FIXED INDEX
X$KSUSE (ind:1) (cr=0 r=0 w=0 time=35 us)'
-- Archives are at http://www.freelists.org/archives/oracle-l/ FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html -----------------------------------------------------------------Received on Wed Aug 25 2004 - 09:25:05 CDT
![]() |
![]() |