Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Location
    Chicago
    Posts
    3

    Unanswered: 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?

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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.

  3. #3
    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.

  4. #4
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    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.

  5. #5
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •