Thursday, April 15, 2010

Find the current session id :

SELECT sid FROM v$mystat WHERE ROWNUM<=1
or
SELECT DISTINCT sid FROM v$mystat
or
SELECT sid FROM v$session WHERE audsid=sys_context('userenv','sessionid')
or
SELECT sid FROM V$SESSION WHERE audsid = USERENV('sessionid');

No comments: