当前位置:网站首页>Oracle 死锁测试
Oracle 死锁测试
2022-07-01 18:49:00 【华为云】
1,建立测试表
create table l (id int);insert into l values(1);insert into l values(2);2,执行锁测试
需要打开2个会话.
| 会话1 | 会话2 |
| select * from l where id=1 for update; | |
| select * from l where id=2 for update; | |
select * from l where id=2 for update; ----等待会话2提交。
| |
select * from l where id=1 for update; ----等待会话1提交。
| |
SQL> select * from l where id=2 for update;
| |
| //需要执行commit,rollback.会话2才能正常执行。 |

3,PG锁测试
| 会话1 | 会话2 |
| begin; | begin; |
| select * from l where id=1 for update; | |
| select * from l where id=2 for update; | |
select * from l where id=2 for update; #会话等待2
| |
select * from l where id=1 for update; #会话2报错,会话rollback; postgres=*# select * from l where id=1 for update; postgres=!# select * from l where id=2 for update; | |
#会话1正常执行。可以正常commit
| |
边栏推荐
- Wechat applet realizes keyword highlighting
- Anaconda installs the virtual environment to the specified path
- EasyCVR集群视频广场页面切换时,请求流未能终止的问题优化
- Technology T3 domestic platform! Successfully equipped with "Yihui domestic real-time system sylixos"
- PowerDesigner设计Name和Comment 替换
- JS的Proxy
- 毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?
- DS transunet: Dual Swing transformer u-net for medical image segmentation
- 面试题篇一
- Oracle physical architecture
猜你喜欢
![Leetcode 1380 lucky numbers in matrix [array] the leetcode path of heroding](/img/56/0c7f39406814b5bf92eca5f6670e10.jpg)
Leetcode 1380 lucky numbers in matrix [array] the leetcode path of heroding

STC 32位8051单片机开发实例教程 二 I/O工作模式及其配置

Interesting! Database is also serverless!

JVM内存模型

全国职业院校技能大赛网络安全“splunk“详细配置

有意思了!数据库也搞Serverless!

Interview question 1

Redis installation and startup in Windows environment (background startup)

Gaussdb (for MySQL):partial result cache, which accelerates the operator by caching intermediate results

Interview questions shared in today's group
随机推荐
JDBC中如何添加事务
全国职业院校技能大赛网络安全“splunk“详细配置
DDR4 test-2
tensorflow报错Could not load dynamic library ‘libcudnn.so.8
Mysql查询结果去除换行
GC垃圾回收
ModSim基本使用(Modbus模拟器)
[research data] observation on the differences of health preservation concepts among people in 2022 - Download attached
有意思了!数据库也搞Serverless!
GC garbage collection
Modsim basic use (Modbus simulator)
mysql 报错 Can‘t create table ‘demo01.tb_Student‘ (errno: 150)*
Basic use of MySQL
Sum the amount
集合对象值改变NULL值对象
uniapp使用腾讯地图选点 没有window监听回传用户的位置信息,怎么处理
list大集合等比分割成多个小list集合
Stack Overflow 2022 开发者调查:行业走向何方?
Mo Tianlun salon | Tsinghua qiaojialin: Apache iotdb, originated from Tsinghua, builds an open source ecological road
Hls4ml/vivado HLS error reporting solution





