Posted By

mifly on 07/15/09


Tagged

sql lockobject


Versions (?)

查看所表记录


 / Published in: SQL
 

  1. SELECT /*+ rule */
  2. LPAD ('--', DECODE (b.BLOCK, 1, 0, 4)) || s.username user_name,
  3. b.TYPE, o.owner || '.' || o.object_name object_name, s.SID,
  4. s.serial#, DECODE (b.request, 0, 'BLOCKED', 'WAITING') status
  5. FROM dba_objects o, v$session s, v$lock v, v$lock b
  6. WHERE v.id1 = o.object_id
  7. AND v.SID = s.SID
  8. AND v.SID = b.SID
  9. AND (b.BLOCK = 1 OR b.request > 0)
  10. AND v.TYPE = 'TM'
  11. ORDER BY b.id2, v.id1, user_name DESC;
  12.  
  13. SELECT b.spid,d.object_name,d.subobject_name ,c.*
  14. FROM V$locked_Object a ,V$process b ,V$session c,all_objects d
  15. WHERE a.SESSION_ID=c.SID AND c.PADDR=b.ADDR AND d.object_id=a.object_id
  16. --and d.object_name='CUST_CLAIM_RESULT'
  17. ;

Report this snippet  

You need to login to post a comment.