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--