Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Oracle中的pg和表锁有区别吗
做
select * from emp for update;
结果表锁定?
和
select * from emp where deptno=10 for update;
导致页面锁定?
Oracle 中没有页锁之类的东西。Oracle 有行级锁和表级锁。
这两个语句都在查询返回的所有行上创建行级锁。EMP第一个在执行查询的 SCN的表中的每一行上创建一个行级锁。第二个在执行查询的 SCN的EMP表中为 10 的表中的每一行创建一个行级锁。DEPTNO这两个查询还将在表上创建一个共享锁,以防止其他会话对表执行 DDL,但这很少是人们在谈论表锁时谈论的内容。
EMP
DEPTNO