题记:查阅了相关资料,对oracle数据库里锁的问题理解更深入了。
一。ORACLE里锁有以下几种模式:

Quotation
0:none
1:null 空
2:Row-S 行共享(RS):共享表锁
3:Row-X 行专用(RX):用于行的修改
4:Share 共享锁(S):阻止其他DML操作
5:S/Row-X 共享行专用(SRX):阻止其他事务操作
6:exclusive 专用(X):独立访问使用


一般的查询语句如select 语句都是小于2级别的锁,
select 且 update等于是2级别的锁。

insert 接着 update 且 delete 是等于3的锁。

当没有commit之前插入同样的一条记录会没有反应,
因为后一个3的锁会一直等待上一个3的锁, 必须释放掉上一个才能继续工作。

一般来说,数字越大锁级别越高, 影响的操作越多,相对越容易出现数据死锁问题。
Pages: [1] [2]

作者:askwan@『AskWan』
地址:http://www.askwan.com/post/2/
可以转载,转载时请以链接形式注明作者和原始出处及本声明!

Tags: ,
DataBase | Comments(0) | Trackbacks(0) | Reads(2705)
收藏到网摘:百度搜藏 Google书签 Yahoo收藏 新浪ViVi收藏夹 365天天网摘 天极网摘 我摘·网摘·网络书签 POCO网摘 和讯网摘 Bolaa博拉博客收录中心 天下图摘
Add a comment
Emots
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
Enable HTML
Enable UBB
Enable Emots
Hidden
Remember
Nickname   Password   Optional
Site URI   Email   [Register]