table lock [message #523162] |
Thu, 15 September 2011 16:07  |
varunvir
Messages: 389 Registered: November 2007
|
Senior Member |
|
|
Hi Experts,
If i am using rowid to delete records, why would the whole table become locked up? Wouldn't it just be just that one record?
Thanks,
Varun
[Updated on: Thu, 15 September 2011 23:20] by Moderator Report message to a moderator
|
|
|
Re: table lock [message #523165 is a reply to message #523162] |
Thu, 15 September 2011 16:34   |
ThomasG
Messages: 3212 Registered: April 2005 Location: Heilbronn, Germany
|
Senior Member |
|
|
Yes, if the application isn't written in some way that would prevent it and then lock the entire table instead.
|
|
|
|
|
Re: table lock [message #523179 is a reply to message #523175] |
Thu, 15 September 2011 20:52   |
andy huang
Messages: 498 Registered: July 2011
|
Senior Member |
|
|
hi,
SQL> Create Table tb_delete
2 (
3 Id Number
4 );
Table created.
SQL> Declare
2 Begin
3 For i In 1 .. 1000 Loop
4 Insert Into Tb_Delete Values (i);
5 End Loop;
6 End;
7 /
PL/SQL procedure successfully completed.
SQL> commit;
Commit complete.
SQL> Select Sid From v$mystat Where Rownum<=1;
SID
----------
15
SQL> Delete tb_delete Where Id=1;
1 row deleted.
open other session
SQL> Select Type,lmode
2 From v$lock Where Sid=15;
TY LMODE
-- ----------
AE 4
UL 4
TO 3
TM 3
TX 6
LMode 3 means: Row Exclusive
|
|
|
|
|
Re: table lock [message #523288 is a reply to message #523286] |
Fri, 16 September 2011 09:22  |
 |
BlackSwan
Messages: 26766 Registered: January 2009 Location: SoCal
|
Senior Member |
|
|
>Pardon my igonorance.It was actualy Row exclusive lock.
are both GOOGLE & Search broken for you?
|
|
|