Monday, March 10, 2008

Session id of current user who is using Oracle ias form or sqlplus



Oracle fuction to know session id of current user who is using either
ias form or sqlplus.

SELECT 'SID='TO_CHAR(SID)' SERIAL#='TO_CHAR(SERIAL#)'
AUDSID='sys_context('USERENV','SESSIONID')
' OSUSER='OSUSER' MACHINE='MACHINE' 'NVL(TERMINAL,'')
INTO :session_info
FROM V$SESSION
WHERE AUDSID= sys_context('USERENV','SESSIONID');

select sys_context('USERENV','SESSIONID') from dual;

Using sys_context('USERENV','SESSIONID') this function you
will get audsid of current user and then
by using this id on V$session table
you will get detail like sid,session#,
machine through which user is using sqlplus.








Chat on a cool, new interface. No download required. Click here.

No comments: