当前位置:网站首页>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
| |
边栏推荐
- docker ubuntu容器中安装mysql遇到的问题
- Regular expression =regex=regular expression
- 一个程序员如何快速成长
- SQL 入门计划-1-选择
- JS proxy
- Install redis under Linux and configure the environment
- February 15, 2022: sweeping robot. There is a floor sweeping robot in the room (represented by a grid). Each grid in the grid has two possibilities: empty and obstacles. The sweeping robot provides fo
- js三元表达式复杂条件判断
- tensorflow报错Could not load dynamic library ‘libcudnn.so.8
- Redis installation and startup in Windows environment (background startup)
猜你喜欢

实例讲解将Graph Explorer搬上JupyterLab

windows环境 redis安装和启动(后台启动)

JS proxy

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

AAAI2020: Real-time Scene Text Detection with Differentiable Binarization

Review the collection container again

Class loading mechanism

MYSLQ十种锁,一篇文章带你全解析

Win11怎么关闭开机自启动软件

Redis installation and startup in Windows environment (background startup)
随机推荐
How to add transactions in JDBC
Leetcode 1380 lucky numbers in matrix [array] the leetcode path of heroding
Class loading mechanism
Redis installation and startup in Windows environment (background startup)
Why has instagram changed from a content sharing platform to a marketing tool? How do independent sellers use this tool?
强大、好用、适合程序员/软件开发者的专业编辑器/笔记软件综合评测和全面推荐
为定时器和延时器等其它情况的回调函数绑定当前作用域的this
February 15, 2022: sweeping robot. There is a floor sweeping robot in the room (represented by a grid). Each grid in the grid has two possibilities: empty and obstacles. The sweeping robot provides fo
Win11如何取消任务栏隐藏?Win11取消任务栏隐藏的方法
简单但现代的服务器仪表板Dashdot
Why must we move from Devops to bizdevops?
Uni app wechat applet one click login to obtain permission function
优质笔记软件综合评测和详细盘点(一) Notion、Obsidian、RemNote、FlowUs
科技T3国产平台!成功搭载“翼辉国产实时系统SylixOS”
STC 32位8051单片机开发实例教程 三 程序编译设置与下载
1592 例题1 国王(Sgu223 LOJ10170 LUOGU1896 提高+/省选-) 暴力思考 状压DP 01背包
MYSLQ十种锁,一篇文章带你全解析
JS proxy
HLS4ML/vivado HLS 报错解决方案





