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...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| <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. |
| |||
| 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 |
| |||
| <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 |
| |||
| 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 |
| ||||
| 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 |