檢視處理Oracle中被鎖物件的SQL
SELECT l.session_id sid, s.serial#, l.locked_mode,l.oracle_username,
l.os_user_name,s.machine, s.terminal, o.object_name, s.logon_time
FROM v$locked_object l, all_objects o, v$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid
ORDER BY sid, s.serial# ;
alter system kill session '679,14748';
select 'alter system kill session '''||sid||','||serial#||''';' from v$session where (sid,serial#) in (SELECT l.session_id sid, s.serial#
FROM v$locked_object l, all_objects o, v$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid) and object_name='PRPJPAYREFREC') ;
alter system kill session '547,46429';
alter system kill session '565,58055';
alter system kill session '735,26695';
alter system kill session '797,52758';
select p.*,s.* from v$session s,v$process p where sid=625 and s.paddr=p.addr
select event,seconds_in_wait,state from v$session_wait where sid=859;
SELECT l.session_id sid, s.serial#, l.locked_mode,l.oracle_username,
l.os_user_name,s.machine, s.terminal, o.object_name, s.logon_time
FROM v$locked_object l, all_objects o, v$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid and s.sid=859
ORDER BY sid, s.serial# ;
select /*+ rule */ lpad('--',decode(b.block,1,0,4))||s.username user_name,
b.type,o.owner||'.'||o.object_name object_name,
s.sid,s.serial#,decode(b.REQUEST,0,'BLOCKED','WAITING') status
FROM dba_objects o,v$session s,v$lock v,v$lock b
where v.ID1=o.object_id and v.SID=s.sid
and v.SID=b.SID and (b.BLOCK=1 or b.REQUEST>0)
and v.TYPE='TM'
order by b.ID2,v.ID1,user_name desc;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/11411056/viewspace-734306/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 檢視ORACLE中鎖定物件Oracle物件
- Oracle檢視被鎖物件及解鎖方法Oracle物件
- Oracle TX鎖的處理Oracle
- oracle 檢視鎖表和解鎖Oracle
- oracle檢視被鎖的表和解鎖Oracle
- Oracle 死鎖處理Oracle
- Oracle死鎖處理Oracle
- 【SQL】Oracle SQL處理的流程SQLOracle
- ORACLE鎖等待的處理方法Oracle
- 處理Oracle Session中的鎖OracleSession
- Oracle SQL處理OracleSQL
- 檢視oracle被鎖的表是誰鎖的Oracle
- DB2檢視鎖等待的SQLDB2SQL
- oracle檢視鎖表程式Oracle
- 檢視Oracle鎖並且釋放鎖Oracle
- Oracle檢視TOP SQLOracleSQL
- oracle 檢視死鎖語句Oracle
- 檢視oracle鎖相關資訊Oracle
- oracle處理SQL的過程OracleSQL
- oracle死鎖的檢視及kill方法Oracle
- ORACLE死鎖及處理方式Oracle
- oracle 死鎖查詢處理Oracle
- 【Oracle】死鎖的產生與處理Oracle
- oracle檢視建立物件的DDL語句Oracle物件
- 【Oracle九大效能檢視】之1.v$lock_處理TX鎖實驗及總結Oracle
- 檢視oracle死鎖程式並結束死鎖Oracle
- Oracle 處理無效物件數Oracle物件
- 《轉》ORACLE LOB 大物件處理Oracle物件
- 關於Oracle死鎖處理方法Oracle
- Oracle死鎖查詢及處理Oracle
- 全面學習MySQL中的檢視(3) 指定檢視處理方式MySql
- 檢視長時間鎖定物件的程式,並kill掉物件
- Oracle 檢視SQL的執行計劃OracleSQL
- 檢視Oracle隱藏引數的SQLOracleSQL
- ORACLE之檢視資料庫的SQLOracle資料庫SQL
- Oracle檢視歷史TOP SQLOracleSQL
- Oracle檢視物件佔用空間Oracle物件
- 處理專案檢視中的選擇