spool holding_session.lst

column object_name justify c heading "Object|Name"  format a32
column username    justify c heading "User|Name"    format a7
column osuser      justify c heading "OS|User"      format a7
column pid         justify c heading "Ora|Proc|ID"  format 999
column serial#     justify c heading "Ora|Serial|#" format 999999
column sid         justify c heading "Holding|Session"  format 999
column spid        justify c heading "Unix|Proc"    format a5
column object_id   justify c heading "Obj|ID"       format 99999
column lockwait    justify c heading "Lock|Wait"
column type        justify c heading "Lock|Type"    format a4
column lmode       justify c heading "Mode"         format 9999

set pagesize 60 linesize 100

select lck.sid, ses.serial#, pro.pid, pro.spid, obj.object_name,
       obj.object_id, ses.username, ses.osuser,
       lck.type, lck.lmode
from dba_blockers blk, dba_objects obj, v$lock lck,
     v$session ses, v$process pro
where blk.holding_session = ses.sid
and   lck.id1   = obj.object_id
and   lck.sid   = ses.sid
and   ses.paddr = pro.addr
and   ses.username is not NULL
order by obj.object_name, ses.lockwait desc, lck.sid;
spool off
clear columns


Reply-To: [EMAIL PROTECTED]
To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]>
Date: Thu, 21 Jun 2001 13:36:00 -0800

Does anyone have any script that will help me find out the locks that are
held in the database.

We are facing a problem related to lock.One of the transaction is holding a
lock on a table and
there is another transaction wanting a lock on that table but waits for long
time .Is there
any lock timeout parameter that can be set on the database.

Thanks
Ravindra

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Ravindra Basavaraja
   INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Mohammad Rafiq
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to