大家好,又见面了,我是你们的朋友全栈君。如果您正在找激活码,请点击查看最新教程,关注关注公众号 “全栈程序员社区” 获取激活教程,可能之前旧版本教程已经失效.最新Idea2022.1教程亲测有效,一键激活。
Jetbrains全系列IDE使用 1年只要46元 售后保障 童叟无欺
一.查询锁定的表
如下语句,都可以查询锁定的表
语句一:
select a.sid,
a.serial#,
p.spid,
c.object_name,
b.session_id,
b.oracle_username,
b.os_user_name
from v$process p, v$session a, v$locked_object b, all_objects c
where p.addr = a.paddr
and a.process = b.process
and c.object_id = b.object_id
and c.OBJECT_name = ‘TABLE_NAME’;
语句二:
SELECT s.sid, s.serial#, o.object_name, s.machine
FROM gv$locked_object l, dba_objects o, gv$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid
AND o.object_name = ‘TABLE_NAME’;
语句三:
SELECT l.session_id sid,
s.serial#,
l.locked_mode,
l.oracle_username,
l.os_user_name,
s.machine,
s.terminal,
o.object_name,
s.logon_time
FROM v$locked_object l, all_objects o, v$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid
AND o.object_name = ‘TABLE_NAME’
ORDER BY sid, s.serial#;
语句四:
select a.sid,
b.serial#,
c.object_name,
decode(a.lmode,
0,
‘None’,
1,
‘Null’,
2,
‘Row-S’,
3,
‘Row-X’,
4,
‘Share’,
5,
‘S/Row-X’,
6,
‘Exclusive’,
‘Unknown’) LockMode,
B.MACHINE,
D.SPID,
b.PROGRAM
from v$lock a, v$session b, all_objects c, V$PROCESS D
where a.sid = b.sid
and a.type in (‘TM’, ‘TX’)
and c.object_id = a.id1
and B.PADDR = D.ADDR
and c.object_name = ‘TABLE_NAME’;
二.kill掉锁住的进程,解锁
–释放SESSION SQL
alter system kill session ‘SID,serial#’;
发布者:全栈程序员-用户IM,转载请注明出处:https://javaforall.cn/172325.html原文链接:https://javaforall.cn
【正版授权,激活自己账号】: Jetbrains全家桶Ide使用,1年售后保障,每天仅需1毛
【官方授权 正版激活】: 官方授权 正版激活 支持Jetbrains家族下所有IDE 使用个人JB账号...