Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: locks?

Re: locks?

From: Tom Pall <tpall_at_cdproc.com>
Date: Thu, 3 Aug 2000 11:35:25 -0500
Message-Id: <10578.113752@fatcity.com>


locks?This is the query, ssql.sql, which Toad uses to display locks. It's the fastest lock code I've ever seen.

SELECT
 OWNER||'.'||OBJECT_NAME "Object",
  OS_USER_NAME "Terminal",
  ORACLE_USERNAME "Locker",
  PROGRAM "Program",
  NVL(lockwait,'ACTIVE') "Wait",
  DECODE(LOCKED_MODE,

    2, 'ROW SHARE',
    3, 'ROW EXCLUSIVE',
    4, 'SHARE',
    5, 'SHARE ROW EXCLUSIVE',
    6, 'EXCLUSIVE',  'UNKNOWN') "Lockmode",
  OBJECT_TYPE "Object Type",
  SESSION_ID "Session ID",
  SERIAL# "Serial",
  c.SID
FROM
  SYS.V_$LOCKED_OBJECT A,
  SYS.ALL_OBJECTS B,
  SYS.V_$SESSION c

WHERE
  A.OBJECT_ID = B.OBJECT_ID AND
  C.SID = A.SESSION_ID
ORDER BY 1 ASC, 5 Desc;

how can i find out the locks existing on a table and by whom? Received on Thu Aug 03 2000 - 11:35:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US