Oracle資料庫的死鎖檢視與處理

2021-05-24 10:37:55 字數 530 閱讀 3830

1.死鎖的檢視:

selects.username, decode(l.type,'tm','table lock', 'tx','row lock', null)

lock_level,

o.owner,o.object_name,o.object_type,

'['||s.sid,s.serial#||']',s.terminal,s.machine,s.program,s.osuser

from v$session s,v$lock l,dba_objects o

where l.sid = s.sid

and l.id1 = o.object_id(+)

and s.username is not null

2. 死鎖的處理:

根據上面的sql語句查詢到sid,serial後,按照如下格式處理:

alter system kill session 'sid,serial#';

例如:alter system kill session '242,38283';

oracle資料庫檢視和解除死鎖

檢視死鎖 select sess.sid,sess.serial lo.oracle username,lo.os user name,ao.object name,lo.locked mode,sess.machine from v locked object lo,dba objects ao,...

檢視資料庫死鎖程序

回答 use master 必須在master資料庫中建立 goif exists select from dbo.sysobjects where id object id n dbo p lockinfo and objectproperty id,n isprocedure 1 drop pr...

oracle資料庫死鎖解決

進入oracle使用者 su oracle 進入dba模式 sqlplus as sysdba 1.查詢被鎖的情況 select object name,machine,s.sid,s.serial from v locked object l,dba objects o v session s w...