当前位置:网站首页>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
| |
边栏推荐
- Why has instagram changed from a content sharing platform to a marketing tool? How do independent sellers use this tool?
- Time series analysis using kibana timelion
- Arduino Stepper库驱动28BYJ-48步进电机测试程序
- 解决VSCode下载慢或下载失败的问题
- tensorflow报错Could not load dynamic library ‘libcudnn.so.8
- Remove line breaks from MySQL query results
- Win11怎么关闭开机自启动软件
- How to correctly use vertx to operate redis (3.9.4 with source code analysis)
- Axure does not display catalogs
- mysql 報錯 Can‘t create table ‘demo01.tb_Student‘ (errno: 150)*
猜你喜欢

关于元宇宙下一代入口——脑机接口的实现

The key to the success of digital transformation enterprises is to create value with data

JS的Proxy

强大、好用、适合程序员/软件开发者的专业编辑器/笔记软件综合评测和全面推荐

A quietly rising domestic software, low-key and powerful!

Solve the problem of slow or failed vscode download

1592 例题1 国王(Sgu223 LOJ10170 LUOGU1896 提高+/省选-) 暴力思考 状压DP 01背包

解决VSCode下载慢或下载失败的问题

Servlet knowledge points

3D全景模型展示可视化技术演示
随机推荐
New window open page -window open
GaussDB(for MySQL) :Partial Result Cache,通过缓存中间结果对算子进行加速
Optimization of video streaming with repeated requests in the case of unstable easygbs network
Win11如何取消任务栏隐藏?Win11取消任务栏隐藏的方法
Unreal Engine packaging project
docker ubuntu容器中安装mysql遇到的问题
Solve the problem of slow or failed vscode download
Easycvr accesses the equipment through the national standard gb28181 protocol. What is the reason for the automatic streaming of the equipment?
Anaconda安装虚拟环境到指定路径
产品模块化设计的前世今生
Shell advanced
Leetcode 1380 lucky numbers in matrix [array] the leetcode path of heroding
3D全景模型展示可视化技术演示
MySQL signale une erreur can 't create table' demo01. TB Étudiant '(errno: 150)
Process steps of vibrating wire acquisition module for measuring vibrating wire sensor
STC 32位8051单片机开发实例教程 二 I/O工作模式及其配置
Oracle physical architecture
Win11怎么关闭开机自启动软件
Axure does not display catalogs
Use of common built-in classes of JS





