当前位置:网站首页>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
| |
边栏推荐
- List is divided into sets that meet and do not meet conditions (partitioningby)
- docker ubuntu容器中安装mysql遇到的问题
- MySQL signale une erreur can 't create table' demo01. TB Étudiant '(errno: 150)
- PowerDesigner design name and comment replacement
- 有意思了!数据库也搞Serverless!
- GaussDB(for MySQL) :Partial Result Cache,通过缓存中间结果对算子进行加速
- 关于元宇宙下一代入口——脑机接口的实现
- 【蓝桥杯Web】2022年第十三届蓝桥杯Web大学组国赛真题解析
- Class loading mechanism
- GC垃圾回收
猜你喜欢

JS的Proxy

STC 32位8051单片机开发实例教程 三 程序编译设置与下载

【无标题】

开发那些事儿:EasyCVR平台添加播放地址鉴权功能

Why must we move from Devops to bizdevops?

Detailed configuration of network security "Splunk" in national vocational college skills competition

Related concepts of cookies and sessions

Graduation season | Huawei experts teach the interview secret: how to get a high paying offer from a large factory?

After studying 11 kinds of real-time chat software, I found that they all have these functions

Interview question 1
随机推荐
一个悄然崛起的国产软件,低调又强大!
【let var const】
[untitled]
Unreal Engine packaging project
PowerDesigner设计Name和Comment 替换
AAAI2020: Real-time Scene Text Detection with Differentiable Binarization
List is divided into sets that meet and do not meet conditions (partitioningby)
毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?
【无标题】
[research materials] Huawei Technology ICT 2021: at the beginning of the "Yuan" year, the industry is "new" -- download attached
安装sharp报错
[research materials] national second-hand housing market monthly report January 2022 - Download attached
JS proxy
CMU AI PhD first year summary
Test self-study people must see: how to find test items in software testing?
DDR4 test-2
Procédure de mesure du capteur d'accord vibrant par le module d'acquisition d'accord vibrant
Review the collection container again
Solve the problem of slow or failed vscode download
使用Zadig从0到1搭建持续交付平台





