Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.tools -> Re: Select not locked rows
"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