ITPub博客

首页 > 应用开发 > IT综合 > kill session

kill session

原创 IT综合 作者:OmarChina 时间:2007-08-28 10:17:56 0 删除 编辑

根据EYGLE的文章自己测试了下。

[@more@]


SQL> select sid,username,status
2 from v$session
3 where username is not null;

SID USERNAME STATUS
---------- ------------------------------ --------
28 SYS ACTIVE
29 READONLY INACTIVE

SQL> select 'kill -9 '||spid from v$process
2 where addr=(select paddr from v$session where sid=&did);
Enter value for did: 29
old 2: where addr=(select paddr from v$session where sid=&did)
new 2: where addr=(select paddr from v$session where sid=29)

'KILL-9'||SPID
-----------------
kill -9 16330

SQL> !
[oracle@ctdb04 u01]$ ps -eaf|grep 16330|grep -v "grep"
oracle 16330 16288 0 10:11 ? 00:00:00 oraclesouthdb (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
[oracle@ctdb04 u01]$ kill -9 16330
[oracle@ctdb04 u01]$ exit
exit

SQL> select sid,username,status
2 from v$session
3 where username is not null;

SID USERNAME STATUS
---------- ------------------------------ --------
28 SYS ACTIVE
29 READONLY INACTIVE

SQL> select sid,username,status,serial#
2 from v$session
3 where username is not null;

SID USERNAME STATUS SERIAL#
---------- ------------------------------ -------- ----------
28 SYS ACTIVE 37611

SQL> alter system kill session '28,37611' immediate;
alter system kill session '28,37611' immediate
*

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

上一篇: 更改DATAFILE位置
下一篇: OMF的使用
请登录后发表评论 登录
全部评论
  • 博文量
    68
  • 访问量
    997076