当前SESSION的SPID

来源:互联网 发布:淘宝商家登录中心 编辑:程序博客网 时间:2024/05/23 00:10

Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

--1.当前sesion的sid为537

SQL> select * from v$mystat where rownum=1;

       SID   STATISTIC#      VALUE
----------   --------------    ----------
       537                  0              1

 

--2.找到当前sesion对应的spid

SQL> select p.spid ,s.sid from  v$process p , v$session s
  2     where p.addr = s.paddr
  3     and s.audsid = userenv('sessionid');

SPID                   SID
------------     ----------
1646678             537

 

--3.用操作系统命令kill掉当前session的spid

SQL> host kill -9 1646678

 

--4.当前sesion的会话已经被中断

SQL> select * from v$mystat where rownum=1;
select * from v$mystat where rownum=1
*
ERROR at line 1:
ORA-03135: connection lost contact

原创粉丝点击