If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Database Share Locks

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 09-29-03, 12:28
bkowalewski bkowalewski is offline
Registered User
 
Join Date: Sep 2003
Location: Chicago
Posts: 3
Database Share Locks

We are DB2 7.1 on OS/390 2.10. I have SAS users that are getting database share locks while they are running their queries. Does anyone have experience with thread-duration database share locks, especially caused by SAS programs?
Reply With Quote
  #2 (permalink)  
Old 09-29-03, 12:48
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
Unless you are using UR isolation level, any program that reads DB2 tables will take a share lock (or higher), either at the row, page, or table level. What problem is occurring as a result of the share locks?

You should look at the isolation level (UR, CS, RS, RR) and locksize (for the table) parameters to determine the best locking strategy for your application.
Reply With Quote
  #3 (permalink)  
Old 09-29-03, 13:31
bkowalewski bkowalewski is offline
Registered User
 
Join Date: Sep 2003
Location: Chicago
Posts: 3
Thanks for the reply, bu the key of the original question was that the locks are database locks, not page, table, or row locks. I would have expected row or page locks as programs traversed the data, clearing out as commits were done, but these SAS programs are taking database level locks. This was detected by user experiences and verified through the TMONDB2 monitor. Also, the DB2 console log does not report any lock escalations on the databases in question at the time the threads were active.. SAS tech support says that SAS does not internally ever do database-level locking.
Reply With Quote
  #4 (permalink)  
Old 09-29-03, 13:56
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
I don't think that there is such a thing as a share lock at the database level. I think the term "database locks" is a generic term that just refers to any locks on individual tables or tablespaces (or pages or rows within those) in that database.

You can issue the DISPLAY DATABASE LOCKS to find out which tables or tablespaces in the database are holding the share locks. Usually these locks are held if an active thread is present and no commit has been performed.

If you are accessing DB2 OS/390 from a remote DDF thread, sometimes the threads hang, leaving the locks in place. In addition, any in-doubt threads must be manually resolved in order to commit or abort the database changes and to release the locks on various objects in the database.
Reply With Quote
  #5 (permalink)  
Old 09-30-03, 12:09
bkowalewski bkowalewski is offline
Registered User
 
Join Date: Sep 2003
Location: Chicago
Posts: 3
I myself have never actually seen database-level locks either, but that is the way TMONDB2 reports them, along with the normal table and pageset locks. It is possible that they mean locks on the Database Descriptor entry, but that isn't exactly clear to me from the TMON doc. I'm still trying to figure out if this problem of the applications users locking themselves out is something special to SAS users, or what. I checked out one program that TMON is reporting these locks, and he looks to be doing the appropriate commits after his internal units of work, doing table and index creates, etc. Does anyone out there who uses TMONDB2 (should be a lot of them) have any insight on these reported "database locks", beyond the normal lock/latch stuff? This investigation is being done in parallel to the normal investigation into whether the applications folk are locking themselves out in more mundane ways.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On