Home » RDBMS Server » Server Administration » table lock (10.2.0.4)
table lock [message #523162] Thu, 15 September 2011 16:07 Go to next message
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 Go to previous messageGo to next message
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 #523166 is a reply to message #523165] Thu, 15 September 2011 17:11 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
It would be helpful if you followed Posting Guidelines - http://www.orafaq.com/forum/t/88153/0/
Re: table lock [message #523175 is a reply to message #523166] Thu, 15 September 2011 20:34 Go to previous messageGo to next message
andy huang
Messages: 498
Registered: July 2011
Senior Member
hi,
Delete does not lock table,and it just lock rowes of you delete!
Re: table lock [message #523179 is a reply to message #523175] Thu, 15 September 2011 20:52 Go to previous messageGo to next message
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 #523213 is a reply to message #523179] Fri, 16 September 2011 04:20 Go to previous messageGo to next message
cookiemonster
Messages: 13959
Registered: September 2008
Location: Rainy Manchester
Senior Member
Got any unindexed foreign keys?
Re: table lock [message #523286 is a reply to message #523213] Fri, 16 September 2011 09:18 Go to previous messageGo to next message
varunvir
Messages: 389
Registered: November 2007
Senior Member
Experts,
Pardon my igonorance.It was actualy Row exclusive lock.

Thanks,
Varun
Re: table lock [message #523288 is a reply to message #523286] Fri, 16 September 2011 09:22 Go to previous message
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?
Previous Topic: Oracle Startup
Next Topic: Configure archivelog stored inside ASM diskgroup
Goto Forum:
  


Current Time: Fri Nov 29 04:24:26 CST 2024