ITPub博客

首页 > Linux操作系统 > Linux操作系统 > LOCK

LOCK

原创 Linux操作系统 作者:xfxyxh 时间:2008-09-17 16:22:40 0 删除 编辑
Lock Modes
Lock Row/Table Prevent Allows Acquiring Statements
RS (Row Share) Row or Table X, RX on the locked rows RS, S, SRX, RX on the rows not locked SELECT … FOR UPDATE LOCK TABLE
RX (Row Exclusive) Row or Table X, SRX, S, RX on the locked rows RS, RX on the rows not locked INSERT
UPDATE
DELETE
LOCK TABLE
S (Share) Table X, SRX, RX RS, S LOCK TABLE
SRX (Share Row Exclusive) Table X, SRX, S, RX RS LOCK TABLE
X (Exclusive) Table X, SRX, S, RX, RS   LOCK TABLE


DML Statement Row Locks? Mode of Table Lock
SELECT ... FROM table    
INSERT INTO table ... X RX
UPDATE table ... X RX
DELETE FROM table ... X RX
SELECT ... FROM table ...    FOR UPDATE OF ... X RS
LOCK TABLE table IN ...    
ROW SHARE MODE   RS
ROW EXCLUSIVE MODE   RX
SHARE MODE   S
SHARE EXCLUSIVE MODE   SRX
EXCLUSIVE MODE   X

TX锁时V$LOCK视图中ID1列和V$TRANSACTION的关系:
XIDUSN = TRUNC(ID1/POWER(2,16))
XIDSLOT = MOD(ID1,POWER(2,16))

http://www.itpub.net/270059.html
http://space.itpub.net/13095417/viewspace-172810
http://space.itpub.net/13095417/viewspace-171152
http://www.cnblogs.com/caizhanshu/articles/1180966.html

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

请登录后发表评论 登录
全部评论

注册时间:2007-12-13

  • 博文量
    21
  • 访问量
    87273