Unix Technical Forum

Locks on table.

This is a discussion on Locks on table. within the DB2 forums, part of the Database Server Software category; --> Hi , How to find out if a table is locked ? Thanks Bikash...


Go Back   Unix Technical Forum > Database Server Software > DB2

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-27-2008, 06:03 AM
bikkaran@in.ibm.com
 
Posts: n/a
Default Locks on table.

Hi ,

How to find out if a table is locked ?

Thanks
Bikash

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-27-2008, 06:03 AM
Mark A
 
Posts: n/a
Default Re: Locks on table.

<bikkaran@in.ibm.com> wrote in message
news:1139811619.781964.152740@g44g2000cwa.googlegr oups.com...
> Hi ,
>
> How to find out if a table is locked ?
>
> Thanks
> Bikash
>


You can do a snapshot for locks (you must turn on the lock monitor first).
See the "Command Reference" manual.

Table level locking occurs in the following ways:

- Table is created with table level locking (instead of row level). See "SQL
Reference Vol 2".
- Lock Table SQL statement as described in "SQL Reference Vol 2".
- Lock escalation from row to table (this will show up in the db2diag.log).
Lock escalation is be influenced by the LOCKLIST and MAXLOCKS database
configuration parameters as described in the "Administration: Performance"
manual.


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-27-2008, 06:03 AM
bikkaran@in.ibm.com
 
Posts: n/a
Default Re: Locks on table.

Hi Mark,

I think as a normal database user I dont have the privilege to use
"get snapshot " command .
I dont have any admin rights on the database.
In this case as a developer point of view , how will I b able to find
out.
Thanks

bikash

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-27-2008, 06:03 AM
Mark A
 
Posts: n/a
Default Re: Locks on table.

<bikkaran@in.ibm.com> wrote in message
news:1139813661.549591.287140@g43g2000cwa.googlegr oups.com...
> Hi Mark,
>
> I think as a normal database user I dont have the privilege to use
> "get snapshot " command .
> I dont have any admin rights on the database.
> In this case as a developer point of view , how will I b able to find
> out.
> Thanks
>
> bikash
>


SOL


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-27-2008, 06:03 AM
Serge Rielau
 
Posts: n/a
Default Re: Locks on table.

bikkaran@in.ibm.com wrote:
> Hi Mark,
>
> I think as a normal database user I dont have the privilege to use
> "get snapshot " command .
> I dont have any admin rights on the database.
> In this case as a developer point of view , how will I b able to find
> out.
> Thanks

The privilege required is SYSMON.
You can do so empirical testing by trying to read soem rows with in
NOWAIT mode.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-27-2008, 06:04 AM
hikums@gmail.com
 
Posts: n/a
Default Re: Locks on table.

Try doing, db2 list applications show detail..
applications in lock_waiting are the ones waiting on it..one of the
ones in the executing state may be the one holding lock..

without having admin privilege, you may not have much luck.
with admin:
you can do
get snapshot for applications to see which app is holding lock, and
which is waiting on it.



Serge Rielau wrote:
> bikkaran@in.ibm.com wrote:
> > Hi Mark,
> >
> > I think as a normal database user I dont have the privilege to use
> > "get snapshot " command .
> > I dont have any admin rights on the database.
> > In this case as a developer point of view , how will I b able to find
> > out.
> > Thanks

> The privilege required is SYSMON.
> You can do so empirical testing by trying to read soem rows with in
> NOWAIT mode.
>
> Cheers
> Serge
> --
> Serge Rielau
> DB2 Solutions Development
> IBM Toronto Lab


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:31 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com