1、查看是否有锁表的sql
select 'blocker('||lb.sid||':'||sb.username||')-sql:'|| qb.sql_text blockers, 'waiter ('||lw.sid||':'||sw.username||')-sql:'|| qw.sql_text waiters from v$lock lb, v$lock lw, v$session sb, v$session sw, v$sql qb, v$sql qw where lb.sid=sb.sid and lw.sid=sw.sid and sb.prev_sql_addr=qb.address and sw.sql_address=qw.address and lb.id1=lw.id1 and sw.lockwait is not null and sb.lockwait is null and lb.block=1 ;
2、查看被锁的表
select p.spid,a.serial#,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 ;
3、查看那个用户那个进程造成死锁,锁的级别
select b.owner,b.object_name,l.session_id,l.locked_mode fromv$locked_object l, dba_objects
4、查看连接的进程
SELECT sid, serial#, username, osuser FROMv$session;
http://www.unitymanual.com/forum-openclass-1.html
5、查看是哪个session引起的
select b.username,b.sid,b.serial#,logon_time from v$locked_object a,v$session b where a.session_id = b.sid order by b.logon_time;
6、杀掉进程
alter system kill session 'sid,serial#';
查看本栏目更多精彩内容:http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/
以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索select
, session
, sid
, username
, and
, spring oracle 锁表
, insertsqlserver锁表
, sqlserver查询时锁表
, 锁表
, 查询正锁表
, SQL锁表
session_id
oracle 查看建表脚本、oracle执行sql脚本、oracle导出sql脚本、oracle导入sql脚本、shell oracle sql脚本,以便于您获取更多的相关知识。