select * from v$session where sid = sys_context('userenv', 'sid' ); select * from v$session where audsid = sys_context('userenv', 'sessionid');
dbms_support
is installed, the corresponding record can also be found with dbms_support.mysid
: select * from v$session where sid=sys.dbms_support.mysid;
dbms_session.unique_session_id
can be used from which value the session's sid, serial# and instance can be calculated. select dbms_debug_jdwp.current_session_id sid, dbms_debug_jdwp.current_session_serial serial# from dual;
mysid.sql
returns the own session's SID (intended to be stored in the $SQLPATH
directory)