当前位置:网站首页>DM8:达梦数据库-锁超时
DM8:达梦数据库-锁超时
2022-06-27 12:01:00 【祢真伟大】
DM8:达梦数据库-锁超时
1、有时候对数据库操作会遇到锁超时
1.1 找到导致阻塞的会话,提交或回滚事务,阻塞解除。
1.2关闭阻塞的会话
SP_CLOSE_SESSION(SESS_ID)
2、通过sql语句查询锁超时相关的事务/会话
SELECT
T1.T1_SESS_ID,T1.T1_SQL_TEXT,T1.T1_TRX_ID,
T2.T2_TW_ID,T2_SQL_TEXT,T2_SESS_ID
FROM
(
SELECT
SESS.SESS_ID T1_SESS_ID ,
SESS.SQL_TEXT T1_SQL_TEXT,
TW.ID T1_TRX_ID ,
TW.WAIT_FOR_ID T1_TW_ID
FROM
V$TRXWAIT TW,
V$SESSIONS SESS
WHERE
TW.ID=SESS.TRX_ID
)
T1,
(
SELECT
SESS.SESS_ID T2_SESS_ID ,
SESS.SQL_TEXT T2_SQL_TEXT,
TW.WAIT_FOR_ID T2_TW_ID
FROM
V$TRXWAIT TW,
V$SESSIONS SESS
WHERE
TW.WAIT_FOR_ID=SESS.TRX_ID
)
T2
WHERE
T1.T1_TW_ID=T2.T2_TW_ID
3、查询结果如图:
4、结果详细说明:
4.1 显示事务等待信息。
SELECT * FROM V$TRXWAIT;
| 序 号 | 列 | 数据类型 | 说明 |
|---|---|---|---|
| 1 | ID | BIGINT | 事务 ID |
| 2 | WAIT_FOR_ID | BIGINT | 所等待的事务 ID |
| 3 | WAIT_TIME | INTEGER | 当前等待时间 |

4.2 显示会话的具体信息,如执行的 sql 语句、主库名、当前会话状态、用户名等等。
SELECT * FROM V$SESSIONS;

4.3 显示活动的事务锁信息。
SELECT * FROM V$LOCK;;
边栏推荐
- R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用step函数基于AIC指标实现逐步回归筛选最佳模型、解读分析模型
- Deep understanding of happens before principle
- R language dplyr package arrange function sorts dataframe data, sorts dataframe data through multiple data columns, specifies the first field to be sorted in descending order, and does not specify the
- 秒云荣获《2022爱分析 · IT运维厂商全景报告》智能运维AIOps市场代表厂商
- What is the TCP 3-time handshake process?
- Minimum editing distance (linear DP writing method)
- MapReduce practical cases (customized sorting, secondary sorting, grouping, zoning)
- 盘点一些好用且小众的 Markdown 编辑器
- Safe landing practice of software supply chain under salesforce containerized ISV scenario
- 在 Golang 中构建 CRUD 应用程序
猜你喜欢

StarCraft's Bug King ia retired for 2 years to engage in AI, and lamented that it was inferior

MySQL高阶语句(一)

56. Core principle of flutter - flutter startup process and rendering pipeline

picocli-入门

号称史上最难618,淘宝数据盘点你做对了吗?

MapReduce实战小案例(自定义排序、二次排序、分组、分区)

How to find the movie and TV clips with the same lines? These 8 movies search for artifact, and find the corresponding segment in one line

AI for Science:科研范式、开源平台和产业形态

Microservice splitting

pull request
随机推荐
C# wpf 实现撤销重做功能
Self taught ADT and OOP
R language dplyr package arrange function sorts dataframe data, sorts dataframe data through multiple data columns, specifies the first field to be sorted in descending order, and does not specify the
Secyun won the "2022 AI analysis · it operation and maintenance vendor panorama report" as the representative vendor of intelligent operation and maintenance aiops Market
[tcapulusdb knowledge base] Introduction to tcapulusdb tcapsvrmgr tool (II)
How to find the movie and TV clips with the same lines? These 8 movies search for artifact, and find the corresponding segment in one line
MapReduce practical cases (customized sorting, secondary sorting, grouping, zoning)
Don't miss it. New media operates 15 treasure official account to share
Maximum path and problem (cherry picking problem)
【TcaplusDB知识库】TcaplusDB-tcapsvrmgr工具介绍(二)
MySQL high level statements (I)
Raspberry pie 3b+ learning
Salesforce 容器化 ISV 场景下的软件供应链安全落地实践
c/s 架构
数学知识——博弈论(巴什博奕、尼姆博奕、威佐夫博奕)思路及例题
R语言使用epiDisplay包的followup.plot函数可视化多个ID(病例)监测指标的纵向随访图、使用stress.labels参数在可视化图像中为强调线添加标签信息
Microservice splitting
Go Web 编程入门:验证器
I.MX6ULL启动方式
dried food! What problems will the intelligent management of retail industry encounter? It is enough to understand this article

