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

Home -> Community -> Usenet -> c.d.o.server -> Re: Who has the row locked?

Re: Who has the row locked?

From: Kenneth Koenraadt <kennethkoenraadt_at_hotmail.com>
Date: 8 Nov 2002 07:36:20 -0800
Message-ID: <1d765a2d.0211080736.5bb31e10@posting.google.com>


Hi Massis,

The Data Dictionary does not hold information on specific rows being locked, but you can find the users currently locking/updating rows in a specific table this way :

select username from v$open_cursor
where upper(sql_text) like '%UPDATE <YOUR_TABLE>%'

And with username in hand, you can get all the session info you want :

select * from
FROM v$session s, v$process p, sys.v_$sess_io si

   WHERE s.paddr = p.addr(+) AND si.sid(+) = s.sid and s.username = <usernames found above>

"Massis Isagholian" <massis_at_att.com> wrote in message news:<ZNzy9.399$hK4.31751_at_bgtnsc05-news.ops.worldnet.att.net>...
> I have an application that needs to determine what process has locked a
> specific row on given table. My application needs to retrieve the following
> information from the database server:
>
> Session ID
> Session Status
> DBase User ID
> OS User ID
> OS Process ID
> Machine Name (client)
> Program Name (ex: myprogram.exe)
> Other lock related info as appropriate
>
> My application is not thread-safe, hence, I prefer not to use multiple
> threads to obtain the information listed above.
>
> I'd appreciate your quick response.
>
> Thanks,
> Massis
Received on Fri Nov 08 2002 - 09:36:20 CST

Original text of this message

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