ORACLE锁的种类和级别

来源:这里教程网 时间:2026-03-03 16:17:29 作者:
1、select
2、lock table xxx in share update mode;
3、for update  update  insert delete
4、create index
5、lock table xxx in share row exclusive mode;
6、alter table drop table drop index truncate table

手动加锁 
lock table xxx in row share mode;       2  SS(RS)
lock table xxx in row exclusive mode;  3  SX(RX)
lock table xxx in share mode;   4  S
lock table xxx in share row exclusive mode;   5  SSX(SRX)
lock table xxx in exclusive mode;     6  X
同一个事务里,先加3/4再加4/3锁,会自动变成5 
3+4=5   4+3=5

相关推荐