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

Home -> Community -> Usenet -> c.d.o.tools -> Re: Select not locked rows

Re: Select not locked rows

From: Rognvald Bjarne <wear_u_out_at_nospam.hotmail.com>
Date: Wed, 16 Aug 2000 12:33:50 -0600
Message-ID: <w8Bm5.16319$gUd6.75759780@news.randori.com>

"Anatoly Moskovsky" <avm_at_trais.com.ua> wrote in message news:8negmu$9jj$1_at_DCS.eurocom.od.ua...
> Hi!
>
> "Uwe Schneider" <us_at_webde-ag.de> wrote in message
> news:399A6768.4DD1C285_at_webde-ag.de...
> > > Is it possible to select for update only not locked rows?
> > > If not, how can I detect if a row has been locked?
> > >
> >
> > SELECT ... WHERE ... FOR UPDATE NOWAIT
> >
>
> So, the first is not possible?

The first is possible--the NOWAIT will select only those rows not currently locked.

> Is there a way to determine if a row has been locked without attempting to
> lock it ?
>
> Bye

This script is usefull for solving resource busy issues and killing unwanted background process made by exclusive lock.

Rem This script should be run from SVRMGR or SYS Rem How to find the exclusive lock process. Rem Note - The sid should be > (System background processes)

SVRMGR>connect internal;

SVRMGR> select a.sid,serial#,process,program,terminal from v$lock a,v$session b where a.lmode=6 and a.sid > 10 and a.sid=b.sid;

--for the actual rows, include the row_wait fields from v$session Received on Wed Aug 16 2000 - 13:33:50 CDT

Original text of this message

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