Skip to content

DB2 Database Snapshot Counter LOCK_TIMEOUTS not being incremented for Lock Timeouts

28-Aug-08

Version information: DB2 64-bit instance Version 9 Fixpack 4 running on Solaris 10.

Summary: DB2 System Monitor elements LOCK_TIMEOUTS and DEADLOCKS both are incremented for SQLCODE -911 (sql0911n) but LOCK_TIMEOUTS is incremented for Reason Code 68 whereas DEADLOCKS is incremented for Reason Code 2. SQLCODE -911 actually covers 3 different timeout scenarios (the third related to DB2 Data Links Manager, Reason Code 72). I don’t know why IBM wouldn’t have given us three separate SQLSTATE’s, it would have been less confusing.

The Problem: On three separate days August 26-28 2008 my production application experienced a large number of lock timeouts (SQLCODE: -911, SQLSTATE: 40001 ) as evidenced by application logs (each incident period recorded over forty separate -911 events, over 100 lock timeouts in 3 days). I did not have access to Reason Code information. The System Monitor element LOCK_TIMEOUTS counter was not being incremented. I capture and store snapshot data every five minutes both via text (db2 get snapshot for all on dbname) and via inserts from Snapshot Administrative View sysibmadm.snapdb.

The Solution: According to IBM (private communication November 2008), monitor element LOCK_TIMEOUTS only gets incremented for SQLCODE -911 Reason Code 68. SQLCODE -911 which occurs due to deadlock results in a different Reason Code of 2. SQLCODE -911 Reason Code 2 will increment System Monitor element DEADLOCKS but not LOCK_TIMEOUTS. The behavior of the two counter elements is mutually exclusive. If you only have access to SQLCODE/SQLSTATE, but not Reason Code, you are left to guess what kind of timeout the -911 was. You can infer it by looking at LOCK_TIMEOUTS and DEADLOCKS elements.
Other APARS about Misleading Snapshot Element Values

Hosting DB2 on Solaris Zones

27-Aug-08

At my current client, a large, well-known dot com, we successfully use Solaris Container (Zone) virtualization technology to host DB2  version 9 instances for all lifecycle stages: Production, Stage and Development. This is significant; it is my understanding that there are very few companies using Solaris Containers to host DB2 server instances.

We have installed DB2 v9 fp4 on several Solaris Zones of flavor Solaris 10 11/06 s10s_u3wos_10 SPARC, SunOS 5.10. The underlying hardware is a T2000 Sun Fire. Separate global zones are provided for each lifecycle stage: Production, Staging and Development. Eight non-global zones are installed for every global zone by company standard. The Production DB2 non-global zone is allocated 10 CPU and 8 GB of memory, 8 GB of swap.

High availability [http://en.wikipedia.org/wiki/High-availability_cluster] on the zones is provided by Veritas Cluster Server (VCS) .

Production has been very stable for seven months now since our January 2008 implementation. I believe the implementation of DB2 version 9 using Solaris Containers has been very successful, and I would recommend this hosting option to other DB2 users.

The ability to quickly modify zone memory and CPU allocation has been a big advantage over non-virtualized environments where I have administered DB2. It has also resulted in huge cost savings for the customer, and VCS has been a great failover technology in conjunction with Solaris Zones.

Opensolaris.org Zones and Containers FAQ