Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

missing IP SYS_CONTEXT('USERENV','IP_ADDRESS')

599963Jun 5 2009 — edited Jun 15 2009
Hi Guys,

I have created after login trigger to audit user connections , im relying on SYS_CONTEXT for some of the variables

v_user_name:=SYS_CONTEXT('USERENV','SESSION_USER');
v_from_host:=SYS_CONTEXT('USERENV','HOST') ;
v_ip:=SYS_CONTEXT('USERENV','IP_ADDRESS') ;
v_osuser:=SYS_CONTEXT('USERENV','OS_USER') ;

select program into v_program from v$session where audsid=sys_context('USERENV','SESSIONID');

but have realized that some time SYS_CONTEXT('USERENV','IP_ADDRESS') ; returns null ! does anyone know why ? or is there any better place to look for IP address ?

Im not sure about SYS_CONTEXT('USERENV','HOST') ; ( assuming it always returns someting ...

thanks for reading.
Ali
This post has been answered by Solomon Yakobson on Jun 5 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 13 2009
Added on Jun 5 2009
2 comments
1,373 views