当前位置:网站首页>oracle查看锁表语句、解锁方法
oracle查看锁表语句、解锁方法
2022-07-28 05:16:00 【Ctrl练习生-谢哥哥blog】
一、锁表查看语句
SELECT
sess.sid,
sess.serial#,
lo.oracle_username, -- 登陆账号名称
lo.os_user_name, -- 登录电脑名称
ao.object_name, -- 被锁表名
lo.locked_mode -- 死锁级别
FROM
v$locked_object lo,
dba_objects ao,
v$session sess
WHERE
ao.object_id = lo.object_id
AND lo.session_id = sess.sid;
死锁级别:
0:none
1:null 空
2:Row-S 行共享(RS):共享表锁
3:Row-X 行专用(RX):用于行的修改
4:Share 共享锁(S):阻止其他DML操作
5:S/Row-X 共享行专用(SRX):阻止其他事务操作
6:exclusive 专用(X):独立访问使用
二、解锁方法
alter system kill session '68,51'; -- 分别为SID和SERIAL#号
三、查看引起锁表的sql语句
SELECT
A.USERNAME,
A.MACHINE,
A.PROGRAM,
A.SID,
A.SERIAL#,
A.STATUS,
C.PIECE,
C.SQL_TEXT
FROM
V$SESSION A,
V$SQLTEXT C
WHERE
A.SID IN ( SELECT DISTINCT T2.SID FROM V$LOCKED_OBJECT T1, V$SESSION T2 WHERE T1.SESSION_ID = T2.SID )
AND A.SQL_ADDRESS = C.ADDRESS ( + )
ORDER BY
C.PIECE;
边栏推荐
- Anaconda common instructions
- Class class added in ES6
- How should programmers keep warm when winter is coming
- Performance test classification
- 【ARXIV2204】Simple Baselines for Image Restoration
- 【CPU占用高】software_reporter_tool.exe
- I've been in an outsourcing company for two years, and I feel like I'm going to die
- 【SLAM】LVI-SAM解析——综述
- 11.< tag-动态规划和子序列, 子数组>lt.115. 不同的子序列 + lt. 583. 两个字符串的删除操作 dbc
- SMD component size metric English system corresponding description
猜你喜欢

Visual studio 2019 new OpenGL project does not need to reconfigure the environment

【内功心法】——函数栈帧的创建和销毁(C实现)

ES6 new variable modifiers let and const, new basic data type symbol

First acquaintance with C language (1)

11. < tag dynamic programming and subsequence, subarray> lt.115. Different subsequences + Lt. 583. Deletion of two strings DBC

First acquaintance with C language (2)

HashSet add

MySQL practice 45 lectures

mysql的日期与时间函数,varchar与date相互转换

7.<tag-字符串和API的取舍>补充: 剑指 Offer 05. 替换空格
随机推荐
Melt cloud x chat, create a "stress free social" habitat with sound
Using RAC to realize the sending logic of verification code
How should programmers keep warm when winter is coming
21 day SQL punch in summary
C language classic 100 question exercise (1~21)
Driving the powerful functions of EVM and xcm, how subwallet enables Boca and moonbeam
HDU 3078 network (lca+ sort)
New modularity in ES6
HDU 3592 World Exhibition (differential constraint)
C language: some self realization of string functions
Reading notes of SMT practical guide 1
About MySQL group_ What concat has to say
FreeRTOS learning (I)
7. < tag string and API trade-offs> supplement: Sword finger offer 05. replace spaces
How about ink cloud?
POJ 2763 housewife wind (tree chain partition + edge weighting point weight)
How to send and receive reports through outlook in FastReport VCL?
【ARIXV2204】Neighborhood attention transformer
CPU and memory usage are too high. How to modify RTSP round robin detection parameters to reduce server consumption?
【计算机三级信息安全】信息安全保障概述