oracle数据库锁表,什么SQL引起了锁表?ORACLE解锁的方法
程序员文章站
2022-11-07 21:17:27
--查询数据库锁表记录 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 ......
--查询数据库锁表记录
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, v$process p where ao.object_id = lo.object_id and lo.session_id = sess.sid -- and object_name = '表名称' ;
--什么sql引起了锁表
select l.session_id sid, s.serial#, l.locked_mode, l.oracle_username, s.user#, l.os_user_name, s.machine, s.terminal, a.sql_text, a.action from v$sqlarea a, v$session s, v$locked_object l where l.session_id = s.sid and s.prev_sql_addr = a.address order by sid, s.serial#;
--oracle解锁的方法
alter system kill session 'sid,serial#';
上一篇: 章惇:北宋铁血宰相,说说他的是非功过
下一篇: 感觉自己上当了