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

Home -> Community -> Usenet -> c.d.o.misc -> Re: How to know if a TABLE or ROW is locked?

Re: How to know if a TABLE or ROW is locked?

From: <sganesh_at_apple.com>
Date: 25 Jul 1999 14:29:00 -0500
Message-ID: <379b576c@discussions>

Hi,

        You can query the table v$locked_object to get the status of the table - whether it is locked/not by whom, which oracle user, which unix user(if you are on unix) etc.,etc., The only thing you need is to join v$locked_object properly with all_objects table and v$session. Following query may help:

select o.OBJECT_NAME, substr(o.OWNER,1,10) owner, substr(l.OS_USER_NAME,1,10) UNIX_USER, l.PROCESS,substr(l.SESSION_ID,1,7)
SID,substr(s.SERIAL#,1,7) SERIAL# from all_objects o, v$locked_object l, v$session s where s.sid=l.session_id and o.OBJECT_ID = l.object_id and SESSION_ID not in ( 2,3);

-Sanjay

robert.bowen_at_mubimedia.com wrote:
>Simple question... Instead of waiting for my PL/SQL cgi to timeout, in>the event that I can't do an update because a table or row is locked,
>is there some kind of query I can run? Like a 'isLocked()' function or
>something?
>
>Thanks in advance!
>syg
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
Received on Sun Jul 25 1999 - 14:29:00 CDT

Original text of this message

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