好文档 - 专业文书写作范文服务资料分享网站

ORACLE数据库查锁和解锁

天下 分享 时间: 加入收藏 我要投稿 点赞

查看锁表进程SQL语句1: select sess.sid sess.serial# lo.oracle_username lo.os_user_name ao.obxxxxject_name lo.locked_mode

from v$locked_obxxxxject lo dba_obxxxxjects ao v$session sess where ao.obxxxxject_id = lo.obxxxxject_id and lo.session_id = sess.sid;

查看锁表进程SQL语句2:

select * from v$session t1 v$locked_obxxxxject t2 where t1.sid = t2.SESSION_ID;

杀掉锁表进程:

如有記錄則表示有lock,記錄下SID和serial# ,將記錄的ID替換下面的7381429,即可解除LOCK

alter system kill session '7381429';

--查询语句 select b.sid sid c.serial# serial c.username username c.osuser osuser c.terminal terminal

decode(b.id20'对象锁''事务-'||to_char(b.id1)) trans_id b.type type

decode(b.lmode0'等待'1'空'2'行子共享模式(SS)'3'行共享互斥模式(SX)' 4'共享模式(S)'5'行子共享互斥模式(SRX)'6'互斥模式(X)'b.lmode) lmode decode(b.request' '1'空'2'行子共享模式(SS)'3'行共享互斥模式(SX)' 4'共享模式(S)'5'行子共享互斥模式(SRX)'6'互斥模式(X)' b.request) request b.ctime ctime

decode(b.block0 '不阻塞'1 '阻塞'2 '全局锁'to_char(block)) block from v$lock bv$session c where b.sid=c.sid

and c.username is not null

order by b.sidb.id2;

ORACLE数据库查锁和解锁

查看锁表进程SQL语句1:selectsess.sidsess.serial#lo.oracle_usernamelo.os_user_nameao.obxxxxject_namelo.locked_modefromv$locked_obxxxxjectlodba_obxxxxje
推荐度:
点击下载文档文档为doc格式
440dm9nt8j8c83h0epna2cg5h8ins2016fw
领取福利

微信扫码领取福利

微信扫码分享