create table aa_test ( id int constraint TEST_PK primary key, name varchar2(50) ) / insert into aa_test values(1,'孙悟空'); insert into aa_test values(2,'猪八戒'); / 第一步 会话1 update aa_test set NAME='孙悟空new' where ID=1; select * from aa_test; / 回话2 update aa_test set NAME='猪八戒old' where ID=2; / 第二步制造死锁 会话2 update aa_test set NAME='孙悟空old' where ID=1; 会话1 update aa_test set NAME='猪八戒new' where ID=2; /