首页 > IT职业 > IT生活 > 茴字的三种写法-找出当前会话ID
Finding the current session's ID
select sid, serial# from v$session where audsid = sys_context('userenv','sessionid');
Or, if you're only interested in the sid, not in serial#:
select distinct sid from v$mystat;
Note, the selected sid has nothing to do with the System Identifier. If dbms_support is installed, the current sid can also be found with its mysid function:
select dbms_support.mysid from dual;
Thanks to Jan Arnoldus who pointed out an error on this page!
dbms_support的包位于 ?/rdbms/admin/dbmssupp.sql 文件中
[@more@]完来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/271063/viewspace-1033334/ ,如需转载,请注明出处,否则将追究法律责任。