kill掉被lock会话

session

PADDR RAW(4 | 8) Address of the processthat owns the session

SID NUMBER Session identifier

SERIAL# NUMBER Session serial number. Usedto uniquely identify a session's objects. Guarantees that session-levelcommands are applied to the correct session objects if the session ends andanother session begins with the same session ID

 

Process

ADDR RAW(4 | 8) Address of the processstate object

SPID VARCHAR2(24) Operating system processidentifier

 

lock

SID NUMBER Identifier for session holdingor acquiring the lock

TYPE VARCHAR2(2) Type of user or systemlock

The locks on the user types are obtained byuser applications. Any process that is blocking others is likely to be holdingone of these locks. The user type locks are:

TM- DML enqueue

TX- Transaction enqueue(排队)

UL- User supplied

The system type locks are listed in Table8–1. Be aware that not all types of locks are documented. To find a completelist of locks for the current release, query the V$LOCK_TYPEdata dictionaryview, described on "V$LOCK_TYPE"on page 8-16.

ID1 NUMBER Lock identifier #1 (depends ontype)

ID2 NUMBER Lock identifier #2 (depends ontype)

 

 

 

Kill掉会话的两种方法

1、制造lock

2、查看被lock的sid以及被堵塞的sid

3、OS层面的kill

4、数据库层面的kill

 

 

一、制造一个简单的锁

开启两个会话窗口,分别做同一张表的相同字段的update,不提交

二、查看lock,寻找SID

select * from v$lock where block=1;  ---这里的block是堵塞的意思

select * from v$lock where id1=… and id2=… type=…

---ty=type

三、寻找SPID

select paddr from v$session where sid=…

select spid from v$process where paddr=addr

四、系统kill

kill -9 spid ---(-9)是无条件kill

五、数据库kill

select sid,serial from v$session where sid=…

alter system kill session ‘sid,serial’;

 

--EOF--

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值