oracle查看锁表进程,杀掉锁表进程

查看锁表进程SQL语句1: 
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;

查看锁表进程SQL语句2: 
select * from v$session t1, v$locked_object t2 where t1.sid = t2.SESSION_ID;

杀掉锁表进程: 
如有記錄則表示有lock,記錄下SID和serial# ,將記錄的ID替換下面的738,1429,即可解除LOCK 
alter system kill session ‘738,1429‘;

时间: 2024-10-26 18:08:19

oracle查看锁表进程,杀掉锁表进程的相关文章

Oracle 表锁住,杀掉锁表进程

背景 在操作Oracle时,多人同时操作oracle数据库的同一张表的时候,经常会造成锁表现象,这时需要手动进行解锁. 步骤 以dba身份登录Oracle数据库(否则用户缺少杀掉进程权限,需要给用户分配权限) sqlplus  /  as sysdba,如下图 查看被锁住的表进程 select b.owner,b.object_name,a.session_id,a.locked_mode from v$locked_object a,dba_objects b where b.object_i

oracle查看被锁的表和被锁的进程,杀掉进程

-- 1. 查看被锁的表 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 -- 2.

Oracle 查看锁表进程_杀掉锁表进程 [转]

查看锁表进程SQL语句1: 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; 查看锁表进程SQL语句2: sel

查看Oracle数据库被锁住的表,删除锁表的进程

锁表处理及查询 查看Oracle数据库被锁住的表,删除锁表的进程 1.查看被锁住的表 SELECT dob.object_name table_name,    lo.locked_mode, lo.session_id, vss.serial#, vss.action action, vss.osuser osuser, vss.logon_time, vss.process ap_pid, vps.spid db_pid FROM v$locked_object lo, dba_object

oracle查看被锁的表及解除锁

-- 查看被锁对象 select object_name,machine,s.sid,s.serial# from v$locked_object l,dba_objects o ,v$session s where l.object_id = o.object_id and l.session_id=s.sid; --杀死进程 alter system kill session '24,111'; (其中24,111分别是上面查询出的sid,serial# ora-00031:session

Oracle查看锁表

查看锁表进程SQL语句1: 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_

oracle 查看锁表情况与解表

oracle 查看锁表情况与解表 CreateTime--2018年4月27日17:24:37 Author:Marydon 1.锁表查询 --锁表查询 SELECT OBJECT_NAME AS TABLE_NAME, MACHINE, S.SID, S.SERIAL# FROM GV$LOCKED_OBJECT L, DBA_OBJECTS O, GV$SESSION S WHERE L.OBJECT_ID = O.OBJECT_ID AND L.SESSION_ID = S.SID; 2.

oracle 查看锁表情况并处理锁表

/* *locked *query locked object and analyse reason,kill it * */ select 'alter system kill session ''' || SID || ',' || SERIAL# || ''';' from (select distinct a.sid, a.Serial#, status, machine, LOCKWAIT, logon_time from v$session a, v$locked_object b

Oracle查看有锁进程,删除锁

查看锁表进程SQL语句1: 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_