[Oracle Script] check lock info
col spid format a10
col inst_id format a7
col owner format a15
col object_name format a20
col machine format a30
col program format a20
select pr.spid,se.inst_id,se.sid,se.serial#,ob.owner,ob.object_name,se.osuser,se.machine,se.terminal,se.program
,gvl1.ctime,(select count(*)-1 from gv$lock where inst_id=gvl2.inst_id and id1=gvl2.id1) as blocking_session,
trunc(gvl2.id1/power(2,16)) xidusn,bitand(gvl2.id1,to_number('ffff','xxxx')) xidslot,gvl2.id2 xidsqn
from gv$lock gvl1,gv$session se,dba_objects ob ,gv$process pr,
(select * from gv$lock where block=1) gvl2
where gvl1.inst_id=gvl2.inst_id and gvl1.sid=gvl2.sid and gvl1.type='TM'
and gvl1.inst_id=se.inst_id and gvl1.sid=se.sid and gvl1.id1=ob.object_id
and se.paddr=pr.addr;
col inst_id format a7
col owner format a15
col object_name format a20
col machine format a30
col program format a20
select pr.spid,se.inst_id,se.sid,se.serial#,ob.owner,ob.object_name,se.osuser,se.machine,se.terminal,se.program
,gvl1.ctime,(select count(*)-1 from gv$lock where inst_id=gvl2.inst_id and id1=gvl2.id1) as blocking_session,
trunc(gvl2.id1/power(2,16)) xidusn,bitand(gvl2.id1,to_number('ffff','xxxx')) xidslot,gvl2.id2 xidsqn
from gv$lock gvl1,gv$session se,dba_objects ob ,gv$process pr,
(select * from gv$lock where block=1) gvl2
where gvl1.inst_id=gvl2.inst_id and gvl1.sid=gvl2.sid and gvl1.type='TM'
and gvl1.inst_id=se.inst_id and gvl1.sid=se.sid and gvl1.id1=ob.object_id
and se.paddr=pr.addr;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24237320/viewspace-2140901/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- [Oracle Script] check tablespace usage infoOracle
- [Oracle Script] LockOracle
- [Oracle Script] check userOracle
- [Oracle Script] check latchOracle
- [Oracle Script] check active sessionOracleSession
- [Oracle Script] check Literal SQLOracleSQL
- [Oracle Script] check temp tablespace usageOracle
- [Oracle Script] check object count by userOracleObject
- [Oracle Script] check File I/OOracle
- check ftp success scriptFTP
- script of check repair ASM DISKGROUPAIASM
- 關於java中的double check lockJava
- oracle scriptOracle
- Oracle Database ScriptOracleDatabase
- [Oracle Script] Top sqlOracleSQL
- Oracle kill session scriptOracleSession
- ORACLE常用Script(轉)Oracle
- ORACLE常用Script (轉)Oracle
- oracle lock鎖_v$lock_轉Oracle
- About Oracle LockOracle
- oracle enqueue lockOracleENQ
- Oracle Latch & LockOracle
- Script to Check for Foreign Key Locking Issues [ID 1019527.6]
- Check the transaction running in oracleOracle
- [Oracle Script] Log switch statusOracle
- [Oracle Script] latch holderOracle
- [Oracle Script] Temporary Sort UsageOracle
- [Oracle Script] Rollback Segment UsageOracle
- ORACLE LOCK,LATCH,PINOracle
- ORACLE LOCK MODE 1.2.3.4.5.6Oracle
- Oracle Lock Information QueriesOracleORM
- Dead lock - oracleOracle
- ORACLE lock 轉貼Oracle
- ORACLE查LOCK表Oracle
- oracle lock系列一Oracle
- ORACLE WITH CHECK OPTION子句詳解Oracle
- ORA-00205: error in identifying control file, check alert log for more infoErrorIDE
- [Oracle Script] select db parameterOracle