当前位置:网站首页>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 | |
边栏推荐
- Arduino Stepper库驱动28BYJ-48步进电机测试程序
- Example explanation: move graph explorer to jupyterlab
- 有意思了!数据库也搞Serverless!
- 面试题篇一
- Simplified pinduoduo product data
- Modsim basic use (Modbus simulator)
- DS transunet: Dual Swing transformer u-net for medical image segmentation
- Hls4ml entry method
- 墨天轮沙龙 | 清华乔嘉林:Apache IoTDB,源于清华,建设开源生态之路
- 新增订单如何防止重复提交
猜你喜欢
开发那些事儿:EasyCVR平台添加播放地址鉴权功能
JS proxy
Axure does not display catalogs
开发那些事儿:EasyCVR集群设备管理页面功能展示优化
Cookie和Session的相关概念
AAAI2020: Real-time Scene Text Detection with Differentiable Binarization
Detailed configuration of network security "Splunk" in national vocational college skills competition
振弦采集模块测量振弦传感器的流程步骤
再回顾集合容器
Process steps of vibrating wire acquisition module for measuring vibrating wire sensor
随机推荐
windows环境 redis安装和启动(后台启动)
MySQL signale une erreur can 't create table' demo01. TB Étudiant '(errno: 150)
Solve the problem of slow or failed vscode download
Interview questions shared in today's group
Review the collection container again
js三元表达式复杂条件判断
Detailed configuration of network security "Splunk" in national vocational college skills competition
torch. nn. functional. Interpolate function
HLS4ML报错The board_part definition was not found for tul.com.tw:pynq-z2:part0:1.0.
DDR4 test-2
Win11怎么关闭开机自启动软件
mysql 報錯 Can‘t create table ‘demo01.tb_Student‘ (errno: 150)*
Tensorflow reports an error, could not load dynamic library 'libcudnn so. eight
EasyCVR集群视频广场页面切换时,请求流未能终止的问题优化
2022/6/8-2022/6/12
集合对象值改变NULL值对象
实例讲解将Graph Explorer搬上JupyterLab
面试题篇一
较真儿学源码系列-InheritableThreadLocal(逐行源码带你分析作者思路)
New window open page -window open