ITPub博客

首页 > IT职业 > IT生活 > 茴字的三种写法-找出当前会话ID

茴字的三种写法-找出当前会话ID

原创 IT生活 作者:wmlm 时间:2010-05-01 16:18:02 0 删除 编辑

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 文件中

引自 http://www.adp-gmbh.ch/ora/misc/find_my_sid.html

[@more@]完

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/271063/viewspace-1033334/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: 浊酒一杯家万里
下一篇: 关于联合
请登录后发表评论 登录
全部评论

注册时间:2008-04-08

  • 博文量
    398
  • 访问量
    3716777