SlideShare a Scribd company logo
#IDUG
Using RELEASE(DEALLOCATE)
and Painful Lessons to be Learned on DB2 Locking
John Campbell
DB2 for z/OS Development
Session Code: 6007
#IDUG
2
Agenda
• Thread reuse using RELEASE(DEALLOCATE)
• Primer on thread reuse with RELEASE bind option
• Considerations and limitations
• Painful Lessons to be Learned on DB2 Locking
• Primer on lock avoidance
• CURRENTDATA(YES) versus CURRENTDATA(NO)
• Ramifications of lock avoidance for SQL
• What should an application programmer do
• Finding packages to safely rebind with CURRENTDATA(NO)
#IDUG
3
“Resources”: Static SQL
• Static statements
• Packages and statements
• Parent locks
• Index look-aside buffer, dynamic prefetch tracking via sequential detection
#IDUG
4
RELEASE - BIND and REBIND Option
• Determines when to release the resources that a program uses
• RELEASE(COMMIT) - Releases resources at commit point
• RELEASE(DEALLOCATE) - Releases resources when thread terminates (child
page/row locks still released at commit)
• RELEASE(INHERITFROMPLAN) – Support added by APAR PM07087
• Default behavior
• BIND PLAN - COMMIT
• BIND PACKAGE - plan value
• REBIND PLAN/PACKAGE existing value
• DB2Binder Utility for JDBC and SQLJ
• DEALLOCATE is default in DB2 10
• COMMIT is default in DB2 9 and earlier releases
#IDUG
Package Allocation
Program A :
“Insert into table 1”
Thread allocation
Sign on, authorization checking
Locate SKCT and SKPT
Allocate CT/PT and STMT1
Start Insert STMT1
Lock table space 1
Lock data page
End STMT1
“insert into table 2”
Allocate STMT2
Start Insert STMT2
Lock table space 2
Lock data page
End STMT2
COMMIT ;
Program A
Stmt 1: Insert into table1
Stmt 2: Insert into table2
SPT01
EDM_SKELTON_POOL
SKCT/SKPT
V10 Thread storage above the bar
V9 EDM thread pool below the bar
CT
PT
SQL Stmt1
SQL Stmt2
I/O
#IDUG
6
Package Allocation and Commit
Program A
Stmt 1: Insert into table1
Stmt 2: Insert into table2
Commit ;
SPT01
EDM_SKELTON_POOL
SKCT/SKPT
V10 Thread storage above the bar
V9 EDM thread pool below the bar
CT
PT
SQL Stmt1
SQL Stmt2
I/O
Expensive Operation!
Lock TS 1
Lock table1 data page
Lock TS 2
Lock table2 data page
RELEASE PT, statements
Unlock data pages
Unlock TS1, TS2
COMMIT
#IDUG
7
Thread Reuse and RELEASE(DEALLOCATE)
• Thread reuse eliminates CPU cost of DB2 thread allocation and deallocation
• CICS
• Protected ENTRYs
• Organic reuse of ENTRYs (or POOL)
• IMS/TM
• Fast Path (IFP) regions
• Wait-For-Input (WFI) regions
• Pseudo Wait-For-Input (PWFI) regions
• DDF
• High Performance DBATs
• WebSphere Type 2 local connections
• Batch with intermediate commits
• Use of RELEASE(DEALLOCATE) coupled with effective thread reuse i.e., thread
persistence
• Further reduces the CPU cost with potential for significant savings (up to 10% plus)
• Resources are held until thread deallocation
• Without thread reuse RELEASE(COMMIT) vs. RELEASE(DEALLOCATE) is a moot point for
discussion
#IDUG
8
Limitations and Considerations
• Virtual and real storage
• DB2 9 and earlier - DBM1 virtual storage below the 2G bar and real storage
• Package information is stored in EDM pool below the bar
• DB2 10 after REBIND - real storage usage
• Package information is stored in thread storage above the bar in DB2 9 and earlier
releases
• Accumulated DB2 object control blocks
• Virtual, real, potentially CPU cost for scanning the objects built up under the thread
• Recommendations
• Design for thread reuse for
• High volume simple transactions
• Complex transactions at a reasonably high rate
• Selectively use RELEASE(DEALLOCATE) on high use packages – use % of Total Acctg Class
7 CPU
• DBM1 31-bit virtual storage constraint (DB2 9)
• Real storage constraint (DB2 10)
• Use CICS or WebSphere parameter to periodically clean up and rejuvenate threads
(thread deallocation)
#IDUG
9
Considerations for Clean Up
• REUSELIMIT (0-10,000) in CICS TS V4R2 - default 1000
• Number of times a thread can be reused before it is terminated
• Use default and monitor DB2 storage usage and adjust the number if needed
• WebSphere Type 2 connection Aged Timeout - default 0
• The interval in seconds before a physical connection is discarded
• Consider setting WAS “aged timeout” to less than 5 min, recommend using 120
secs to reduce exposure of long living threads
• DB2 10 High Performance DBATs (threads)
• Thread will go inactive every 200 commits
• No user control for this value
• DB2 11 optimizes RELEASE(DEALLOCATE) execution so that it is consistently
better performing than RELEASE(COMMIT)
#IDUG
10
Considerations - Concurrency
• More persistent threads with RELEASE(DEALLOCATE) is also trade off with
concurrency
• BIND/REBIND
• SQL DDL
• Online REORG which invalidates packages
• For RELEASE(DEALLOCATE) some locks are held beyond commit until thread
termination
• Mass delete locks (SQL DELETE without WHERE clause)
• Gross level lock acquired on behalf of a SQL LOCK TABLE
• Table space defined with LOCKSIZE TABLESPACE|TABLE
• Note: no longer a problem for gross level lock acquired by lock escalation
• DO YOUR HOMEWORK BEFORE USING PERSISTENT THREADS WITH
RELEASE(DEALLOCATE) BIND OPTION
#IDUG
11
Primer on lock avoidance
• Combination of techniques used by DB2 to try to avoid taking a S page/row
locks when processing for read only SQL whilst preventing the retrieval of
uncommitted data by the application
• (1) Page latching (and page p-lock in data sharing) controlled by DB2 to ensure
physical consistency of the page
• (2) Commit log sequence number (CLSN) – at the page level
• DB2 tracks "time" of last update to page (on page) (A)
• DB2 tracks "time" of oldest uncommitted activity on every pageset/partition (B)
• Non Data Sharing
• CLSN = lowest uncommitted RBA for all active transactions for a given pageset
• Data Sharing
• For non-GBP-dependent page sets, each member uses a local CLSN = lowest uncommitted LRSN for all active
transactions for a given pageset
• For GBP-dependent page sets, a Global CLSN value is maintained for the entire data sharing group = lowest CLSN value
across all members across all page sets (GBP-dependent or not)
• If (A) < (B) everything on the page is guaranteed to be committed
• Else, check Possibly UNCommitted bits (PUNC bits)
#IDUG
12
Primer on lock avoidance …
• Combination of techniques to prevent retrieval of uncommitted data …
• (3) Possibly UNCommitted bits (PUNC bits) – at the row level
• On each row, a PUNC bit is set when the row is updated
• PUNC bits are periodically reset
• If successful CLSN check and more than 25% of the rows have the PUNC bit ON
• RR scanner
• REORG TABLESPACE
• If the PUNC bit is not ON, the row/key is guaranteed to be committed
#IDUG
13
CURRENTDATA(YES) versus CURRENTDATA(NO) …
• Plans and packages have a better chance for lock avoidance if they are bound
with ISOLATION(CS) and CURRENTDATA(NO)
• What is CURRENTDATA?
• Helps to determine the currency and stability of data returned to an application
cursor
• Only applies to applications bound with ISOLATION(CS)
• What is isolation CURSOR STABILITY(CS)?
• Data fetched by a cursor is committed, but if the application process returns to the
same page, another application might have since updated, deleted, or inserted
qualifying rows
• If the cursor is defined as FOR UPDATE OF
• Data returned by the cursor is stable and it may not be updated by another
transaction while the updatable cursor is positioned on it
• If the cursor is defined as FOR READ|FETCH ONLY, or it is implicitly read only (or it is
ambiguous)
• ISOLATION(CS) ensures that the data returned is committed and the stability of
the cursor is determined by the CURRENTDATA option
#IDUG
14
Primer on lock avoidance …
• Benefits of lock avoidance
• Improved concurrency through less lock collisions
• Decrease in lock and unlock activity requests, with an associated decrease in CPU
resource consumption and data sharing overhead
• V8 improvements
• Lock avoidance for non-cursor ‘singleton’ SELECT
• In V7, ISOLATION(CS) CURRENTDATA(YES) acquires S page/row lock on the
qualified row
• In V8, DB2 no longer acquires and hold S page/row lock on the qualified row for
ISOLATION(CS) CURRENTDATA(YES or NO)
• Overflow lock avoidance when the update of a variable length row in a data page
results in a new row that cannot fit in that page i.e., indirect reference
• In V7, no lock avoidance on both pointer and overflow
• In V8, lock on pointer only
• Need to distinguish carefully between eligibility for lock avoidance and
actually achieving it
#IDUG
15
Primer on lock avoidance …
• BIND option ISOLATION(CS) with CURRENTDATA(NO) could
reduce # Lock/Unlock requests dramatically
• High Unlock requests/commit could also be possible from
• Large number of relocated rows after update of compressed or VL
row
• Lock/Unlock of pointer record (or page)
• Large number of pseudo-deleted entries in unique indexes
• Lock/Unlock of data (page or row) in insert to unique index when
pseudo-deleted entries exist
• Both can be eliminated by REORG
Field Name Description
QTXALOCK LOCK REQUESTS
QTXAUNLK UNLOCK REQUESTS
LOCKING ACTIVITY QUANTITY /SECOND /THREAD /COMMIT
------------------------ -------- ------- ------- -------
...
LOCK REQUESTS 521.0M 24.2K 3134.34 1050.75
UNLOCK REQUESTS 478.1M 22.2K 2876.06 964.16
Lock avoidance may not be working effectively if
Unlock requests/commit is high, e.g. >5
ROT
#IDUG
16
Primer on lock avoidance …
• Effective lock avoidance is very important in data sharing
• Global locks propagated beyond IRLM to Coupling Facility are relatively expensive
• Global management of lock contention/resolution is very expensive
• Effective Lock avoidance is critical to achieving good performance and lower data
sharing overhead
• Any long-running UR(s) can reduce the effectiveness of lock avoidance by stopping
the Global CLSN value from moving forward
• Recommendation: Aggressively monitor long-running URs
• 'First cut' ROTs:
• URs running for a long time without committing: zparm URCHKTH<=5
• Message DSNR035I
• URs performing massive update activity without committing: zparm
URLGWTH=10(K)
• Message DSNJ031I
• Need management ownership and process for getting rogue applications fixed up
so that they commit frequently based on
• Elapsed time and/or
• CPU time (no. of SQL update statements)
#IDUG
17
CURRENTDATA(YES) versus CURRENTDATA(NO) …
• Switching from CURRENTDATA(YES) to CURRENTDATA(NO)
• In general, can be done without any adverse effect to applications
• But consider the following scenario:
1. Program A bound with ISOLATION(CS) CURRENTDATA(YES) fetches a row from
a cursor with ORDER BY – and the row is read from the base table and not from
a work file
2. Program B tries to update the row just read by Program A
• The access is not allowed because the CURRENTDATA(YES) option for Program A caused a lock to
be acquired on the page/row in the base table
3. Program A then issues a searched UPDATE of the row just fetched from step 1.
• In the above example CURRENTDATA(YES) protects the integrity of the data read by
Program A in between the FETCH and the searched UPDATE
• If Program A was to be rebound with CURRENTDATA(NO) then
1. Program B may (should) be able to access the row just fetched by Program A
• This assumes correct timing and that lock avoidance is effective
2. When Program A issues the searched UPDATE, it could wipe out the changes
just made by Program B
#IDUG
18
CURRENTDATA(YES) versus CURRENTDATA(NO) …
• Switching from CURRENTDATA(YES) to CURRENTDATA(NO) …
• Now reconsider the same scenario:
1. Program A bound with ISOLATION(CS) CURRENTDATA(YES) fetches a row from
a cursor with ORDER BY, but the row is now read from a work file
2. Program B tries to update the row just read by Program A
1. Access is now allowed as there is no lock on the page/row in the base table
3. Program A then issues a searched UPDATE of the row just fetched from step 1
• In the above example CURRENTDATA(YES) does NOT protects the integrity of the
data read by Program A in between the FETCH and the searched UPDATE
#IDUG
19
Ramifications of lock avoidance for SQL
• Data may be returned without a lock
• All data returned will be committed at the time it is taken from page
• But may change by the time the application sees it
• DB2 only attempts lock avoidance for ISOLATION(CS) transactions when BOTH
of the following are true:
• The plan/package is bound CURRENTDATA(NO)
• The cursor (if cursor-based FETCH) is declared FOR READ|FETCH ONLY, or has some
other attribute (e.g., ORDER BY) that makes it a read-only cursor
• Applications that depend on the stability of what is under a read only cursor,
should use CURRENTDATA(YES)
• Default is CURRENTDATA(NO)
• Now lets look at another example
#IDUG
20
Ramifications of lock avoidance for SQL …
• Example
DECLARE CURSOR AS ...
SELECT THIRD_COL ... WHERE CLUST_COL = 'ABC'
AND ANOTHER_COL = 'DEF'
ORDER BY CLUST_COL; <--- makes cursor read only
FETCH ... <--- say this returns row ABC.DEF.GHI without taking a lock
UPDATE SET … WHERE CLUST_COL = 'ABC'
AND ANOTHER_COL = 'DEF'
AND THIRD_COL = 'GHI‘
• What is the issue?
• Row may no longer be ABC.DEF.GHI by the time update executes
• Another transaction may have gotten in and updated it to ABC.DEF.XYZ
• So update will receive "row not found"
#IDUG
21
What should an application programmer do
• Use programming techniques which avoid possible data currency exposures and access path
dependencies (these sometimes occur regardless of the CURRENTDATA option)
• Define cursors with their intended use
• Easier to read application code
• Number of ambiguous cursors can be reduced
• Some queries will not allow the use of a FOR UPDATE cursor due to possible work file usage e.g.,
with ORDER BY
• Use predicates on searched updates to enforce data currency
• When a FOR UPDATE cursor cannot be used with a query it is common for application
programmers to use a read only with a subsequent searched UPDATE or DELETE
• It is important to use WHERE predicates to ensure that data has not changed since your cursor
first selected the data
• Include all columns which logically determine if the update is necessary, instead of updating
based solely on the key
• This is an exposure regardless of the CURRENTDATA option, but the use of CURRENTDATA(NO)
can increase the exposure opportunity
• Consider the use of a timestamp or a version number
• Add a timestamp or version number column to a table to record the last update
• Select the timestamp or version number column with the cursor
• Use it as a predicate on the searched UPDATE or DELETE to ensure that an application is
updating the same row
#IDUG
22
Finding packages to safely rebind with CURRENTDATA(NO)
• Must recognise that access path dependencies will inevitably occur
• CURRENTDATA(YES) will not stop access path dependency and associated
exposures
• Access path independence and CURRENTDATA(NO) should be the goal for all
applications
• Can safely rebind packages that use only true read-only cursors with
CURRENTDATA(NO)
#IDUG
23
#IDUG
John Campbell
DB2 for z/OS Development
campbelj@uk.ibm.com
Session 6007
Using RELEASE(DEALLOCATE) and Painful Lessons to be Learned on DB2 Locking

More Related Content

What's hot

Educational seminar lessons learned from customer db2 for z os health check...
Educational seminar   lessons learned from customer db2 for z os health check...Educational seminar   lessons learned from customer db2 for z os health check...
Educational seminar lessons learned from customer db2 for z os health check...
John Campbell
 
Introduction of ISPF
Introduction of ISPFIntroduction of ISPF
Introduction of ISPF
Anil Bharti
 
A DBA’s guide to using TSA
A DBA’s guide to using TSAA DBA’s guide to using TSA
A DBA’s guide to using TSA
Frederik Engelen
 
Less06 networking
Less06 networkingLess06 networking
Less06 networking
Amit Bhalla
 
Db2 and storage management (mullins)
Db2 and storage management (mullins)Db2 and storage management (mullins)
Db2 and storage management (mullins)
Craig Mullins
 
A First Look at the DB2 10 DSNZPARM Changes
A First Look at the DB2 10 DSNZPARM ChangesA First Look at the DB2 10 DSNZPARM Changes
A First Look at the DB2 10 DSNZPARM Changes
Willie Favero
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers
MariaDB plc
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
MongoDB
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
Yogiji Creations
 
Implementation and Use of Generic VTAM Resources with Parallel SYSPLEX Features
Implementation and Use of Generic VTAM Resources with Parallel SYSPLEX FeaturesImplementation and Use of Generic VTAM Resources with Parallel SYSPLEX Features
Implementation and Use of Generic VTAM Resources with Parallel SYSPLEX Features
CA Technologies
 
Intro to Cassandra
Intro to CassandraIntro to Cassandra
Intro to Cassandra
DataStax Academy
 
DB2 for z/OS - Starter's guide to memory monitoring and control
DB2 for z/OS - Starter's guide to memory monitoring and controlDB2 for z/OS - Starter's guide to memory monitoring and control
DB2 for z/OS - Starter's guide to memory monitoring and control
Florence Dubois
 
BlueStore: a new, faster storage backend for Ceph
BlueStore: a new, faster storage backend for CephBlueStore: a new, faster storage backend for Ceph
BlueStore: a new, faster storage backend for Ceph
Sage Weil
 
DB2 Accounting Reporting
DB2  Accounting ReportingDB2  Accounting Reporting
DB2 Accounting Reporting
John Campbell
 
Sql database object
Sql database objectSql database object
Sql database object
Harry Potter
 
An Overview of Apache Cassandra
An Overview of Apache CassandraAn Overview of Apache Cassandra
An Overview of Apache Cassandra
DataStax
 
Normalisation muzz
Normalisation muzzNormalisation muzz
Normalisation muzz
muzzii27
 
Oracle R12 EBS Performance Tuning
Oracle R12 EBS Performance TuningOracle R12 EBS Performance Tuning
Oracle R12 EBS Performance Tuning
Scott Jenner
 
Deep Dive: a technical insider's view of NetBackup 8.1 and NetBackup Appliances
Deep Dive: a technical insider's view of NetBackup 8.1 and NetBackup AppliancesDeep Dive: a technical insider's view of NetBackup 8.1 and NetBackup Appliances
Deep Dive: a technical insider's view of NetBackup 8.1 and NetBackup Appliances
Veritas Technologies LLC
 
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLTop 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
Jim Mlodgenski
 

What's hot (20)

Educational seminar lessons learned from customer db2 for z os health check...
Educational seminar   lessons learned from customer db2 for z os health check...Educational seminar   lessons learned from customer db2 for z os health check...
Educational seminar lessons learned from customer db2 for z os health check...
 
Introduction of ISPF
Introduction of ISPFIntroduction of ISPF
Introduction of ISPF
 
A DBA’s guide to using TSA
A DBA’s guide to using TSAA DBA’s guide to using TSA
A DBA’s guide to using TSA
 
Less06 networking
Less06 networkingLess06 networking
Less06 networking
 
Db2 and storage management (mullins)
Db2 and storage management (mullins)Db2 and storage management (mullins)
Db2 and storage management (mullins)
 
A First Look at the DB2 10 DSNZPARM Changes
A First Look at the DB2 10 DSNZPARM ChangesA First Look at the DB2 10 DSNZPARM Changes
A First Look at the DB2 10 DSNZPARM Changes
 
Running MariaDB in multiple data centers
Running MariaDB in multiple data centersRunning MariaDB in multiple data centers
Running MariaDB in multiple data centers
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Oracle backup and recovery
Oracle backup and recoveryOracle backup and recovery
Oracle backup and recovery
 
Implementation and Use of Generic VTAM Resources with Parallel SYSPLEX Features
Implementation and Use of Generic VTAM Resources with Parallel SYSPLEX FeaturesImplementation and Use of Generic VTAM Resources with Parallel SYSPLEX Features
Implementation and Use of Generic VTAM Resources with Parallel SYSPLEX Features
 
Intro to Cassandra
Intro to CassandraIntro to Cassandra
Intro to Cassandra
 
DB2 for z/OS - Starter's guide to memory monitoring and control
DB2 for z/OS - Starter's guide to memory monitoring and controlDB2 for z/OS - Starter's guide to memory monitoring and control
DB2 for z/OS - Starter's guide to memory monitoring and control
 
BlueStore: a new, faster storage backend for Ceph
BlueStore: a new, faster storage backend for CephBlueStore: a new, faster storage backend for Ceph
BlueStore: a new, faster storage backend for Ceph
 
DB2 Accounting Reporting
DB2  Accounting ReportingDB2  Accounting Reporting
DB2 Accounting Reporting
 
Sql database object
Sql database objectSql database object
Sql database object
 
An Overview of Apache Cassandra
An Overview of Apache CassandraAn Overview of Apache Cassandra
An Overview of Apache Cassandra
 
Normalisation muzz
Normalisation muzzNormalisation muzz
Normalisation muzz
 
Oracle R12 EBS Performance Tuning
Oracle R12 EBS Performance TuningOracle R12 EBS Performance Tuning
Oracle R12 EBS Performance Tuning
 
Deep Dive: a technical insider's view of NetBackup 8.1 and NetBackup Appliances
Deep Dive: a technical insider's view of NetBackup 8.1 and NetBackup AppliancesDeep Dive: a technical insider's view of NetBackup 8.1 and NetBackup Appliances
Deep Dive: a technical insider's view of NetBackup 8.1 and NetBackup Appliances
 
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQLTop 10 Mistakes When Migrating From Oracle to PostgreSQL
Top 10 Mistakes When Migrating From Oracle to PostgreSQL
 

Viewers also liked

DB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer ExperiencesDB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer Experiences
John Campbell
 
ALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARMALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARM
IBM
 
IBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration Basics
IBM
 
Planning and executing a DB2 11 for z/OS Migration by Ian Cook
Planning and executing a DB2 11 for z/OS  Migration  by Ian Cook Planning and executing a DB2 11 for z/OS  Migration  by Ian Cook
Planning and executing a DB2 11 for z/OS Migration by Ian Cook
Surekha Parekh
 
DB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
DB2 10 & 11 for z/OS System Performance Monitoring and OptimisationDB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
DB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
John Campbell
 
IBM DB2 Analytics Accelerator Trends & Directions by Namik Hrle
IBM DB2 Analytics Accelerator  Trends & Directions by Namik Hrle IBM DB2 Analytics Accelerator  Trends & Directions by Namik Hrle
IBM DB2 Analytics Accelerator Trends & Directions by Namik Hrle
Surekha Parekh
 
Key Note Session IDUG DB2 Seminar, 16th April London - Julian Stuhler .Trito...
Key Note Session  IDUG DB2 Seminar, 16th April London - Julian Stuhler .Trito...Key Note Session  IDUG DB2 Seminar, 16th April London - Julian Stuhler .Trito...
Key Note Session IDUG DB2 Seminar, 16th April London - Julian Stuhler .Trito...
Surekha Parekh
 
Cassandra Introduction & Features
Cassandra Introduction & FeaturesCassandra Introduction & Features
Cassandra Introduction & Features
DataStax Academy
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Mike Dirolf
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeper
Saurav Haloi
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcached
Jurriaan Persyn
 
Intro to HBase
Intro to HBaseIntro to HBase
Intro to HBase
alexbaranau
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
Dvir Volk
 
Final project report on max life insurance 2
Final  project report on max life insurance 2Final  project report on max life insurance 2
Final project report on max life insurance 2
Student
 

Viewers also liked (14)

DB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer ExperiencesDB2 11 for z/OS Migration Planning and Early Customer Experiences
DB2 11 for z/OS Migration Planning and Early Customer Experiences
 
ALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARMALL ABOUT DB2 DSNZPARM
ALL ABOUT DB2 DSNZPARM
 
IBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration BasicsIBM DB2 for z/OS Administration Basics
IBM DB2 for z/OS Administration Basics
 
Planning and executing a DB2 11 for z/OS Migration by Ian Cook
Planning and executing a DB2 11 for z/OS  Migration  by Ian Cook Planning and executing a DB2 11 for z/OS  Migration  by Ian Cook
Planning and executing a DB2 11 for z/OS Migration by Ian Cook
 
DB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
DB2 10 & 11 for z/OS System Performance Monitoring and OptimisationDB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
DB2 10 & 11 for z/OS System Performance Monitoring and Optimisation
 
IBM DB2 Analytics Accelerator Trends & Directions by Namik Hrle
IBM DB2 Analytics Accelerator  Trends & Directions by Namik Hrle IBM DB2 Analytics Accelerator  Trends & Directions by Namik Hrle
IBM DB2 Analytics Accelerator Trends & Directions by Namik Hrle
 
Key Note Session IDUG DB2 Seminar, 16th April London - Julian Stuhler .Trito...
Key Note Session  IDUG DB2 Seminar, 16th April London - Julian Stuhler .Trito...Key Note Session  IDUG DB2 Seminar, 16th April London - Julian Stuhler .Trito...
Key Note Session IDUG DB2 Seminar, 16th April London - Julian Stuhler .Trito...
 
Cassandra Introduction & Features
Cassandra Introduction & FeaturesCassandra Introduction & Features
Cassandra Introduction & Features
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Introduction to Apache ZooKeeper
Introduction to Apache ZooKeeperIntroduction to Apache ZooKeeper
Introduction to Apache ZooKeeper
 
Introduction to memcached
Introduction to memcachedIntroduction to memcached
Introduction to memcached
 
Intro to HBase
Intro to HBaseIntro to HBase
Intro to HBase
 
Introduction to Redis
Introduction to RedisIntroduction to Redis
Introduction to Redis
 
Final project report on max life insurance 2
Final  project report on max life insurance 2Final  project report on max life insurance 2
Final project report on max life insurance 2
 

Similar to Using Release(deallocate) and Painful Lessons to be learned on DB2 locking

Hpverticacertificationguide 150322232921-conversion-gate01
Hpverticacertificationguide 150322232921-conversion-gate01Hpverticacertificationguide 150322232921-conversion-gate01
Hpverticacertificationguide 150322232921-conversion-gate01
Anvith S. Upadhyaya
 
Hp vertica certification guide
Hp vertica certification guideHp vertica certification guide
Hp vertica certification guide
neinamat
 
IDUG NA 2014 / 11 tips for DB2 11 for z/OS
IDUG NA 2014 / 11 tips for DB2 11 for z/OSIDUG NA 2014 / 11 tips for DB2 11 for z/OS
IDUG NA 2014 / 11 tips for DB2 11 for z/OS
Cuneyt Goksu
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
AiougVizagChapter
 
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum
 
NewSQL Database Overview
NewSQL Database OverviewNewSQL Database Overview
NewSQL Database Overview
Steve Min
 
BigData Developers MeetUp
BigData Developers MeetUpBigData Developers MeetUp
BigData Developers MeetUp
Christian Johannsen
 
VoltDB.ppt
VoltDB.pptVoltDB.ppt
VoltDB.ppt
ssuser2c91ab
 
DBCC - Dubi Lebel
DBCC - Dubi LebelDBCC - Dubi Lebel
DBCC - Dubi Lebel
sqlserver.co.il
 
OracleStore: A Highly Performant RawStore Implementation for Hive Metastore
OracleStore: A Highly Performant RawStore Implementation for Hive MetastoreOracleStore: A Highly Performant RawStore Implementation for Hive Metastore
OracleStore: A Highly Performant RawStore Implementation for Hive Metastore
DataWorks Summit
 
Top 20 FAQs on the Autonomous Database
Top 20 FAQs on the Autonomous DatabaseTop 20 FAQs on the Autonomous Database
Top 20 FAQs on the Autonomous Database
Sandesh Rao
 
COUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_FeaturesCOUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_Features
Alfredo Abate
 
Jdbc Best Practices - DB2/ IDUG - Orlando, May 10, 2004
Jdbc Best Practices - DB2/ IDUG - Orlando, May 10, 2004Jdbc Best Practices - DB2/ IDUG - Orlando, May 10, 2004
Jdbc Best Practices - DB2/ IDUG - Orlando, May 10, 2004
derek_clark_ashmore
 
Ibm db2 case study
Ibm db2 case studyIbm db2 case study
Ibm db2 case study
Ishvitha Badhri
 
Cisco at v mworld 2015 vmworld - cisco mds and emc xtrem_io-v2
Cisco at v mworld 2015 vmworld - cisco mds and emc xtrem_io-v2Cisco at v mworld 2015 vmworld - cisco mds and emc xtrem_io-v2
Cisco at v mworld 2015 vmworld - cisco mds and emc xtrem_io-v2
ldangelo0772
 
Lessons learned from Isbank - A Story of a DB2 for z/OS Initiative
Lessons learned from Isbank - A Story of a DB2 for z/OS InitiativeLessons learned from Isbank - A Story of a DB2 for z/OS Initiative
Lessons learned from Isbank - A Story of a DB2 for z/OS Initiative
Cuneyt Goksu
 
Best practices for Data warehousing with Amazon Redshift - AWS PS Summit Canb...
Best practices for Data warehousing with Amazon Redshift - AWS PS Summit Canb...Best practices for Data warehousing with Amazon Redshift - AWS PS Summit Canb...
Best practices for Data warehousing with Amazon Redshift - AWS PS Summit Canb...
Amazon Web Services
 
Copy Data Management for the DBA
Copy Data Management for the DBACopy Data Management for the DBA
Copy Data Management for the DBA
Kellyn Pot'Vin-Gorman
 
iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...
iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...
iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...
DataStax Academy
 
Leveraging Cassandra for real-time multi-datacenter public cloud analytics
Leveraging Cassandra for real-time multi-datacenter public cloud analyticsLeveraging Cassandra for real-time multi-datacenter public cloud analytics
Leveraging Cassandra for real-time multi-datacenter public cloud analytics
Julien Anguenot
 

Similar to Using Release(deallocate) and Painful Lessons to be learned on DB2 locking (20)

Hpverticacertificationguide 150322232921-conversion-gate01
Hpverticacertificationguide 150322232921-conversion-gate01Hpverticacertificationguide 150322232921-conversion-gate01
Hpverticacertificationguide 150322232921-conversion-gate01
 
Hp vertica certification guide
Hp vertica certification guideHp vertica certification guide
Hp vertica certification guide
 
IDUG NA 2014 / 11 tips for DB2 11 for z/OS
IDUG NA 2014 / 11 tips for DB2 11 for z/OSIDUG NA 2014 / 11 tips for DB2 11 for z/OS
IDUG NA 2014 / 11 tips for DB2 11 for z/OS
 
Aioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_featuresAioug vizag oracle12c_new_features
Aioug vizag oracle12c_new_features
 
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
Maaz Anjum - IOUG Collaborate 2013 - An Insight into Space Realization on ODA...
 
NewSQL Database Overview
NewSQL Database OverviewNewSQL Database Overview
NewSQL Database Overview
 
BigData Developers MeetUp
BigData Developers MeetUpBigData Developers MeetUp
BigData Developers MeetUp
 
VoltDB.ppt
VoltDB.pptVoltDB.ppt
VoltDB.ppt
 
DBCC - Dubi Lebel
DBCC - Dubi LebelDBCC - Dubi Lebel
DBCC - Dubi Lebel
 
OracleStore: A Highly Performant RawStore Implementation for Hive Metastore
OracleStore: A Highly Performant RawStore Implementation for Hive MetastoreOracleStore: A Highly Performant RawStore Implementation for Hive Metastore
OracleStore: A Highly Performant RawStore Implementation for Hive Metastore
 
Top 20 FAQs on the Autonomous Database
Top 20 FAQs on the Autonomous DatabaseTop 20 FAQs on the Autonomous Database
Top 20 FAQs on the Autonomous Database
 
COUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_FeaturesCOUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_Features
 
Jdbc Best Practices - DB2/ IDUG - Orlando, May 10, 2004
Jdbc Best Practices - DB2/ IDUG - Orlando, May 10, 2004Jdbc Best Practices - DB2/ IDUG - Orlando, May 10, 2004
Jdbc Best Practices - DB2/ IDUG - Orlando, May 10, 2004
 
Ibm db2 case study
Ibm db2 case studyIbm db2 case study
Ibm db2 case study
 
Cisco at v mworld 2015 vmworld - cisco mds and emc xtrem_io-v2
Cisco at v mworld 2015 vmworld - cisco mds and emc xtrem_io-v2Cisco at v mworld 2015 vmworld - cisco mds and emc xtrem_io-v2
Cisco at v mworld 2015 vmworld - cisco mds and emc xtrem_io-v2
 
Lessons learned from Isbank - A Story of a DB2 for z/OS Initiative
Lessons learned from Isbank - A Story of a DB2 for z/OS InitiativeLessons learned from Isbank - A Story of a DB2 for z/OS Initiative
Lessons learned from Isbank - A Story of a DB2 for z/OS Initiative
 
Best practices for Data warehousing with Amazon Redshift - AWS PS Summit Canb...
Best practices for Data warehousing with Amazon Redshift - AWS PS Summit Canb...Best practices for Data warehousing with Amazon Redshift - AWS PS Summit Canb...
Best practices for Data warehousing with Amazon Redshift - AWS PS Summit Canb...
 
Copy Data Management for the DBA
Copy Data Management for the DBACopy Data Management for the DBA
Copy Data Management for the DBA
 
iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...
iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...
iland Internet Solutions: Leveraging Cassandra for real-time multi-datacenter...
 
Leveraging Cassandra for real-time multi-datacenter public cloud analytics
Leveraging Cassandra for real-time multi-datacenter public cloud analyticsLeveraging Cassandra for real-time multi-datacenter public cloud analytics
Leveraging Cassandra for real-time multi-datacenter public cloud analytics
 

Recently uploaded

Getting Started with Interactive Brokers API and Python.pdf
Getting Started with Interactive Brokers API and Python.pdfGetting Started with Interactive Brokers API and Python.pdf
Getting Started with Interactive Brokers API and Python.pdf
Riya Sen
 
Unit 1 Introduction to DATA SCIENCE .pptx
Unit 1 Introduction to DATA SCIENCE .pptxUnit 1 Introduction to DATA SCIENCE .pptx
Unit 1 Introduction to DATA SCIENCE .pptx
Priyanka Jadhav
 
SOFTWARE ENGINEERING-UNIT-1SOFTWARE ENGINEERING
SOFTWARE ENGINEERING-UNIT-1SOFTWARE ENGINEERINGSOFTWARE ENGINEERING-UNIT-1SOFTWARE ENGINEERING
SOFTWARE ENGINEERING-UNIT-1SOFTWARE ENGINEERING
PrabhuB33
 
Selcuk Topal Arbitrum Scientific Report.pdf
Selcuk Topal Arbitrum Scientific Report.pdfSelcuk Topal Arbitrum Scientific Report.pdf
Selcuk Topal Arbitrum Scientific Report.pdf
SelcukTOPAL2
 
Vrinda store data analysis project using Excel
Vrinda store data analysis project using ExcelVrinda store data analysis project using Excel
Vrinda store data analysis project using Excel
SantuJana12
 
Technology used in Ott data analysis project
Technology used in Ott data analysis  projectTechnology used in Ott data analysis  project
Technology used in Ott data analysis project
49AkshitYadav
 
future-of-asset-management-future-of-asset-management
future-of-asset-management-future-of-asset-managementfuture-of-asset-management-future-of-asset-management
future-of-asset-management-future-of-asset-management
Aadee4
 
DESIGN AND DEVELOPMENT OF AUTO OXYGEN CONCENTRATOR WITH SOS ALERT FOR HIKING ...
DESIGN AND DEVELOPMENT OF AUTO OXYGEN CONCENTRATOR WITH SOS ALERT FOR HIKING ...DESIGN AND DEVELOPMENT OF AUTO OXYGEN CONCENTRATOR WITH SOS ALERT FOR HIKING ...
DESIGN AND DEVELOPMENT OF AUTO OXYGEN CONCENTRATOR WITH SOS ALERT FOR HIKING ...
JeevanKp7
 
SAMPLE PRODUCT RESEARCH PR - strikingly.pptx
SAMPLE PRODUCT RESEARCH PR - strikingly.pptxSAMPLE PRODUCT RESEARCH PR - strikingly.pptx
SAMPLE PRODUCT RESEARCH PR - strikingly.pptx
wojakmodern
 
Systane Global education training centre
Systane Global education training centreSystane Global education training centre
Systane Global education training centre
AkhinaRomdoni
 
Histology of Muscle types histology o.ppt
Histology of Muscle types histology o.pptHistology of Muscle types histology o.ppt
Histology of Muscle types histology o.ppt
SamanArshad11
 
393947940-The-Dell-EMC-PowerMax-Family-Overview.pdf
393947940-The-Dell-EMC-PowerMax-Family-Overview.pdf393947940-The-Dell-EMC-PowerMax-Family-Overview.pdf
393947940-The-Dell-EMC-PowerMax-Family-Overview.pdf
Ladislau5
 
Data Storytelling Final Project for MBA 635
Data Storytelling Final Project for MBA 635Data Storytelling Final Project for MBA 635
Data Storytelling Final Project for MBA 635
HeidiLivengood
 
The Rise of Python in Finance,Automating Trading Strategies: _.pdf
The Rise of Python in Finance,Automating Trading Strategies: _.pdfThe Rise of Python in Finance,Automating Trading Strategies: _.pdf
The Rise of Python in Finance,Automating Trading Strategies: _.pdf
Riya Sen
 
SFBA Splunk Usergroup meeting July 17, 2024
SFBA Splunk Usergroup meeting July 17, 2024SFBA Splunk Usergroup meeting July 17, 2024
SFBA Splunk Usergroup meeting July 17, 2024
Becky Burwell
 
Where to order Frederick Community College diploma?
Where to order Frederick Community College diploma?Where to order Frederick Community College diploma?
Where to order Frederick Community College diploma?
SomalyEng
 
Harnessing Wild and Untamed (Publicly Available) Data for the Cost efficient ...
Harnessing Wild and Untamed (Publicly Available) Data for the Cost efficient ...Harnessing Wild and Untamed (Publicly Available) Data for the Cost efficient ...
Harnessing Wild and Untamed (Publicly Available) Data for the Cost efficient ...
weiwchu
 
Cal Girls The Lalit Jaipur 8445551418 Khusi Top Class Girls Call Jaipur Avail...
Cal Girls The Lalit Jaipur 8445551418 Khusi Top Class Girls Call Jaipur Avail...Cal Girls The Lalit Jaipur 8445551418 Khusi Top Class Girls Call Jaipur Avail...
Cal Girls The Lalit Jaipur 8445551418 Khusi Top Class Girls Call Jaipur Avail...
deepikakumaridk25
 
Annex K RBF's The World Game pdf document
Annex K RBF's The World Game pdf documentAnnex K RBF's The World Game pdf document
Annex K RBF's The World Game pdf document
Steven McGee
 
Towards an Analysis-Ready, Cloud-Optimised service for FAIR fusion data
Towards an Analysis-Ready, Cloud-Optimised service for FAIR fusion dataTowards an Analysis-Ready, Cloud-Optimised service for FAIR fusion data
Towards an Analysis-Ready, Cloud-Optimised service for FAIR fusion data
Samuel Jackson
 

Recently uploaded (20)

Getting Started with Interactive Brokers API and Python.pdf
Getting Started with Interactive Brokers API and Python.pdfGetting Started with Interactive Brokers API and Python.pdf
Getting Started with Interactive Brokers API and Python.pdf
 
Unit 1 Introduction to DATA SCIENCE .pptx
Unit 1 Introduction to DATA SCIENCE .pptxUnit 1 Introduction to DATA SCIENCE .pptx
Unit 1 Introduction to DATA SCIENCE .pptx
 
SOFTWARE ENGINEERING-UNIT-1SOFTWARE ENGINEERING
SOFTWARE ENGINEERING-UNIT-1SOFTWARE ENGINEERINGSOFTWARE ENGINEERING-UNIT-1SOFTWARE ENGINEERING
SOFTWARE ENGINEERING-UNIT-1SOFTWARE ENGINEERING
 
Selcuk Topal Arbitrum Scientific Report.pdf
Selcuk Topal Arbitrum Scientific Report.pdfSelcuk Topal Arbitrum Scientific Report.pdf
Selcuk Topal Arbitrum Scientific Report.pdf
 
Vrinda store data analysis project using Excel
Vrinda store data analysis project using ExcelVrinda store data analysis project using Excel
Vrinda store data analysis project using Excel
 
Technology used in Ott data analysis project
Technology used in Ott data analysis  projectTechnology used in Ott data analysis  project
Technology used in Ott data analysis project
 
future-of-asset-management-future-of-asset-management
future-of-asset-management-future-of-asset-managementfuture-of-asset-management-future-of-asset-management
future-of-asset-management-future-of-asset-management
 
DESIGN AND DEVELOPMENT OF AUTO OXYGEN CONCENTRATOR WITH SOS ALERT FOR HIKING ...
DESIGN AND DEVELOPMENT OF AUTO OXYGEN CONCENTRATOR WITH SOS ALERT FOR HIKING ...DESIGN AND DEVELOPMENT OF AUTO OXYGEN CONCENTRATOR WITH SOS ALERT FOR HIKING ...
DESIGN AND DEVELOPMENT OF AUTO OXYGEN CONCENTRATOR WITH SOS ALERT FOR HIKING ...
 
SAMPLE PRODUCT RESEARCH PR - strikingly.pptx
SAMPLE PRODUCT RESEARCH PR - strikingly.pptxSAMPLE PRODUCT RESEARCH PR - strikingly.pptx
SAMPLE PRODUCT RESEARCH PR - strikingly.pptx
 
Systane Global education training centre
Systane Global education training centreSystane Global education training centre
Systane Global education training centre
 
Histology of Muscle types histology o.ppt
Histology of Muscle types histology o.pptHistology of Muscle types histology o.ppt
Histology of Muscle types histology o.ppt
 
393947940-The-Dell-EMC-PowerMax-Family-Overview.pdf
393947940-The-Dell-EMC-PowerMax-Family-Overview.pdf393947940-The-Dell-EMC-PowerMax-Family-Overview.pdf
393947940-The-Dell-EMC-PowerMax-Family-Overview.pdf
 
Data Storytelling Final Project for MBA 635
Data Storytelling Final Project for MBA 635Data Storytelling Final Project for MBA 635
Data Storytelling Final Project for MBA 635
 
The Rise of Python in Finance,Automating Trading Strategies: _.pdf
The Rise of Python in Finance,Automating Trading Strategies: _.pdfThe Rise of Python in Finance,Automating Trading Strategies: _.pdf
The Rise of Python in Finance,Automating Trading Strategies: _.pdf
 
SFBA Splunk Usergroup meeting July 17, 2024
SFBA Splunk Usergroup meeting July 17, 2024SFBA Splunk Usergroup meeting July 17, 2024
SFBA Splunk Usergroup meeting July 17, 2024
 
Where to order Frederick Community College diploma?
Where to order Frederick Community College diploma?Where to order Frederick Community College diploma?
Where to order Frederick Community College diploma?
 
Harnessing Wild and Untamed (Publicly Available) Data for the Cost efficient ...
Harnessing Wild and Untamed (Publicly Available) Data for the Cost efficient ...Harnessing Wild and Untamed (Publicly Available) Data for the Cost efficient ...
Harnessing Wild and Untamed (Publicly Available) Data for the Cost efficient ...
 
Cal Girls The Lalit Jaipur 8445551418 Khusi Top Class Girls Call Jaipur Avail...
Cal Girls The Lalit Jaipur 8445551418 Khusi Top Class Girls Call Jaipur Avail...Cal Girls The Lalit Jaipur 8445551418 Khusi Top Class Girls Call Jaipur Avail...
Cal Girls The Lalit Jaipur 8445551418 Khusi Top Class Girls Call Jaipur Avail...
 
Annex K RBF's The World Game pdf document
Annex K RBF's The World Game pdf documentAnnex K RBF's The World Game pdf document
Annex K RBF's The World Game pdf document
 
Towards an Analysis-Ready, Cloud-Optimised service for FAIR fusion data
Towards an Analysis-Ready, Cloud-Optimised service for FAIR fusion dataTowards an Analysis-Ready, Cloud-Optimised service for FAIR fusion data
Towards an Analysis-Ready, Cloud-Optimised service for FAIR fusion data
 

Using Release(deallocate) and Painful Lessons to be learned on DB2 locking

  • 1. #IDUG Using RELEASE(DEALLOCATE) and Painful Lessons to be Learned on DB2 Locking John Campbell DB2 for z/OS Development Session Code: 6007
  • 2. #IDUG 2 Agenda • Thread reuse using RELEASE(DEALLOCATE) • Primer on thread reuse with RELEASE bind option • Considerations and limitations • Painful Lessons to be Learned on DB2 Locking • Primer on lock avoidance • CURRENTDATA(YES) versus CURRENTDATA(NO) • Ramifications of lock avoidance for SQL • What should an application programmer do • Finding packages to safely rebind with CURRENTDATA(NO)
  • 3. #IDUG 3 “Resources”: Static SQL • Static statements • Packages and statements • Parent locks • Index look-aside buffer, dynamic prefetch tracking via sequential detection
  • 4. #IDUG 4 RELEASE - BIND and REBIND Option • Determines when to release the resources that a program uses • RELEASE(COMMIT) - Releases resources at commit point • RELEASE(DEALLOCATE) - Releases resources when thread terminates (child page/row locks still released at commit) • RELEASE(INHERITFROMPLAN) – Support added by APAR PM07087 • Default behavior • BIND PLAN - COMMIT • BIND PACKAGE - plan value • REBIND PLAN/PACKAGE existing value • DB2Binder Utility for JDBC and SQLJ • DEALLOCATE is default in DB2 10 • COMMIT is default in DB2 9 and earlier releases
  • 5. #IDUG Package Allocation Program A : “Insert into table 1” Thread allocation Sign on, authorization checking Locate SKCT and SKPT Allocate CT/PT and STMT1 Start Insert STMT1 Lock table space 1 Lock data page End STMT1 “insert into table 2” Allocate STMT2 Start Insert STMT2 Lock table space 2 Lock data page End STMT2 COMMIT ; Program A Stmt 1: Insert into table1 Stmt 2: Insert into table2 SPT01 EDM_SKELTON_POOL SKCT/SKPT V10 Thread storage above the bar V9 EDM thread pool below the bar CT PT SQL Stmt1 SQL Stmt2 I/O
  • 6. #IDUG 6 Package Allocation and Commit Program A Stmt 1: Insert into table1 Stmt 2: Insert into table2 Commit ; SPT01 EDM_SKELTON_POOL SKCT/SKPT V10 Thread storage above the bar V9 EDM thread pool below the bar CT PT SQL Stmt1 SQL Stmt2 I/O Expensive Operation! Lock TS 1 Lock table1 data page Lock TS 2 Lock table2 data page RELEASE PT, statements Unlock data pages Unlock TS1, TS2 COMMIT
  • 7. #IDUG 7 Thread Reuse and RELEASE(DEALLOCATE) • Thread reuse eliminates CPU cost of DB2 thread allocation and deallocation • CICS • Protected ENTRYs • Organic reuse of ENTRYs (or POOL) • IMS/TM • Fast Path (IFP) regions • Wait-For-Input (WFI) regions • Pseudo Wait-For-Input (PWFI) regions • DDF • High Performance DBATs • WebSphere Type 2 local connections • Batch with intermediate commits • Use of RELEASE(DEALLOCATE) coupled with effective thread reuse i.e., thread persistence • Further reduces the CPU cost with potential for significant savings (up to 10% plus) • Resources are held until thread deallocation • Without thread reuse RELEASE(COMMIT) vs. RELEASE(DEALLOCATE) is a moot point for discussion
  • 8. #IDUG 8 Limitations and Considerations • Virtual and real storage • DB2 9 and earlier - DBM1 virtual storage below the 2G bar and real storage • Package information is stored in EDM pool below the bar • DB2 10 after REBIND - real storage usage • Package information is stored in thread storage above the bar in DB2 9 and earlier releases • Accumulated DB2 object control blocks • Virtual, real, potentially CPU cost for scanning the objects built up under the thread • Recommendations • Design for thread reuse for • High volume simple transactions • Complex transactions at a reasonably high rate • Selectively use RELEASE(DEALLOCATE) on high use packages – use % of Total Acctg Class 7 CPU • DBM1 31-bit virtual storage constraint (DB2 9) • Real storage constraint (DB2 10) • Use CICS or WebSphere parameter to periodically clean up and rejuvenate threads (thread deallocation)
  • 9. #IDUG 9 Considerations for Clean Up • REUSELIMIT (0-10,000) in CICS TS V4R2 - default 1000 • Number of times a thread can be reused before it is terminated • Use default and monitor DB2 storage usage and adjust the number if needed • WebSphere Type 2 connection Aged Timeout - default 0 • The interval in seconds before a physical connection is discarded • Consider setting WAS “aged timeout” to less than 5 min, recommend using 120 secs to reduce exposure of long living threads • DB2 10 High Performance DBATs (threads) • Thread will go inactive every 200 commits • No user control for this value • DB2 11 optimizes RELEASE(DEALLOCATE) execution so that it is consistently better performing than RELEASE(COMMIT)
  • 10. #IDUG 10 Considerations - Concurrency • More persistent threads with RELEASE(DEALLOCATE) is also trade off with concurrency • BIND/REBIND • SQL DDL • Online REORG which invalidates packages • For RELEASE(DEALLOCATE) some locks are held beyond commit until thread termination • Mass delete locks (SQL DELETE without WHERE clause) • Gross level lock acquired on behalf of a SQL LOCK TABLE • Table space defined with LOCKSIZE TABLESPACE|TABLE • Note: no longer a problem for gross level lock acquired by lock escalation • DO YOUR HOMEWORK BEFORE USING PERSISTENT THREADS WITH RELEASE(DEALLOCATE) BIND OPTION
  • 11. #IDUG 11 Primer on lock avoidance • Combination of techniques used by DB2 to try to avoid taking a S page/row locks when processing for read only SQL whilst preventing the retrieval of uncommitted data by the application • (1) Page latching (and page p-lock in data sharing) controlled by DB2 to ensure physical consistency of the page • (2) Commit log sequence number (CLSN) – at the page level • DB2 tracks "time" of last update to page (on page) (A) • DB2 tracks "time" of oldest uncommitted activity on every pageset/partition (B) • Non Data Sharing • CLSN = lowest uncommitted RBA for all active transactions for a given pageset • Data Sharing • For non-GBP-dependent page sets, each member uses a local CLSN = lowest uncommitted LRSN for all active transactions for a given pageset • For GBP-dependent page sets, a Global CLSN value is maintained for the entire data sharing group = lowest CLSN value across all members across all page sets (GBP-dependent or not) • If (A) < (B) everything on the page is guaranteed to be committed • Else, check Possibly UNCommitted bits (PUNC bits)
  • 12. #IDUG 12 Primer on lock avoidance … • Combination of techniques to prevent retrieval of uncommitted data … • (3) Possibly UNCommitted bits (PUNC bits) – at the row level • On each row, a PUNC bit is set when the row is updated • PUNC bits are periodically reset • If successful CLSN check and more than 25% of the rows have the PUNC bit ON • RR scanner • REORG TABLESPACE • If the PUNC bit is not ON, the row/key is guaranteed to be committed
  • 13. #IDUG 13 CURRENTDATA(YES) versus CURRENTDATA(NO) … • Plans and packages have a better chance for lock avoidance if they are bound with ISOLATION(CS) and CURRENTDATA(NO) • What is CURRENTDATA? • Helps to determine the currency and stability of data returned to an application cursor • Only applies to applications bound with ISOLATION(CS) • What is isolation CURSOR STABILITY(CS)? • Data fetched by a cursor is committed, but if the application process returns to the same page, another application might have since updated, deleted, or inserted qualifying rows • If the cursor is defined as FOR UPDATE OF • Data returned by the cursor is stable and it may not be updated by another transaction while the updatable cursor is positioned on it • If the cursor is defined as FOR READ|FETCH ONLY, or it is implicitly read only (or it is ambiguous) • ISOLATION(CS) ensures that the data returned is committed and the stability of the cursor is determined by the CURRENTDATA option
  • 14. #IDUG 14 Primer on lock avoidance … • Benefits of lock avoidance • Improved concurrency through less lock collisions • Decrease in lock and unlock activity requests, with an associated decrease in CPU resource consumption and data sharing overhead • V8 improvements • Lock avoidance for non-cursor ‘singleton’ SELECT • In V7, ISOLATION(CS) CURRENTDATA(YES) acquires S page/row lock on the qualified row • In V8, DB2 no longer acquires and hold S page/row lock on the qualified row for ISOLATION(CS) CURRENTDATA(YES or NO) • Overflow lock avoidance when the update of a variable length row in a data page results in a new row that cannot fit in that page i.e., indirect reference • In V7, no lock avoidance on both pointer and overflow • In V8, lock on pointer only • Need to distinguish carefully between eligibility for lock avoidance and actually achieving it
  • 15. #IDUG 15 Primer on lock avoidance … • BIND option ISOLATION(CS) with CURRENTDATA(NO) could reduce # Lock/Unlock requests dramatically • High Unlock requests/commit could also be possible from • Large number of relocated rows after update of compressed or VL row • Lock/Unlock of pointer record (or page) • Large number of pseudo-deleted entries in unique indexes • Lock/Unlock of data (page or row) in insert to unique index when pseudo-deleted entries exist • Both can be eliminated by REORG Field Name Description QTXALOCK LOCK REQUESTS QTXAUNLK UNLOCK REQUESTS LOCKING ACTIVITY QUANTITY /SECOND /THREAD /COMMIT ------------------------ -------- ------- ------- ------- ... LOCK REQUESTS 521.0M 24.2K 3134.34 1050.75 UNLOCK REQUESTS 478.1M 22.2K 2876.06 964.16 Lock avoidance may not be working effectively if Unlock requests/commit is high, e.g. >5 ROT
  • 16. #IDUG 16 Primer on lock avoidance … • Effective lock avoidance is very important in data sharing • Global locks propagated beyond IRLM to Coupling Facility are relatively expensive • Global management of lock contention/resolution is very expensive • Effective Lock avoidance is critical to achieving good performance and lower data sharing overhead • Any long-running UR(s) can reduce the effectiveness of lock avoidance by stopping the Global CLSN value from moving forward • Recommendation: Aggressively monitor long-running URs • 'First cut' ROTs: • URs running for a long time without committing: zparm URCHKTH<=5 • Message DSNR035I • URs performing massive update activity without committing: zparm URLGWTH=10(K) • Message DSNJ031I • Need management ownership and process for getting rogue applications fixed up so that they commit frequently based on • Elapsed time and/or • CPU time (no. of SQL update statements)
  • 17. #IDUG 17 CURRENTDATA(YES) versus CURRENTDATA(NO) … • Switching from CURRENTDATA(YES) to CURRENTDATA(NO) • In general, can be done without any adverse effect to applications • But consider the following scenario: 1. Program A bound with ISOLATION(CS) CURRENTDATA(YES) fetches a row from a cursor with ORDER BY – and the row is read from the base table and not from a work file 2. Program B tries to update the row just read by Program A • The access is not allowed because the CURRENTDATA(YES) option for Program A caused a lock to be acquired on the page/row in the base table 3. Program A then issues a searched UPDATE of the row just fetched from step 1. • In the above example CURRENTDATA(YES) protects the integrity of the data read by Program A in between the FETCH and the searched UPDATE • If Program A was to be rebound with CURRENTDATA(NO) then 1. Program B may (should) be able to access the row just fetched by Program A • This assumes correct timing and that lock avoidance is effective 2. When Program A issues the searched UPDATE, it could wipe out the changes just made by Program B
  • 18. #IDUG 18 CURRENTDATA(YES) versus CURRENTDATA(NO) … • Switching from CURRENTDATA(YES) to CURRENTDATA(NO) … • Now reconsider the same scenario: 1. Program A bound with ISOLATION(CS) CURRENTDATA(YES) fetches a row from a cursor with ORDER BY, but the row is now read from a work file 2. Program B tries to update the row just read by Program A 1. Access is now allowed as there is no lock on the page/row in the base table 3. Program A then issues a searched UPDATE of the row just fetched from step 1 • In the above example CURRENTDATA(YES) does NOT protects the integrity of the data read by Program A in between the FETCH and the searched UPDATE
  • 19. #IDUG 19 Ramifications of lock avoidance for SQL • Data may be returned without a lock • All data returned will be committed at the time it is taken from page • But may change by the time the application sees it • DB2 only attempts lock avoidance for ISOLATION(CS) transactions when BOTH of the following are true: • The plan/package is bound CURRENTDATA(NO) • The cursor (if cursor-based FETCH) is declared FOR READ|FETCH ONLY, or has some other attribute (e.g., ORDER BY) that makes it a read-only cursor • Applications that depend on the stability of what is under a read only cursor, should use CURRENTDATA(YES) • Default is CURRENTDATA(NO) • Now lets look at another example
  • 20. #IDUG 20 Ramifications of lock avoidance for SQL … • Example DECLARE CURSOR AS ... SELECT THIRD_COL ... WHERE CLUST_COL = 'ABC' AND ANOTHER_COL = 'DEF' ORDER BY CLUST_COL; <--- makes cursor read only FETCH ... <--- say this returns row ABC.DEF.GHI without taking a lock UPDATE SET … WHERE CLUST_COL = 'ABC' AND ANOTHER_COL = 'DEF' AND THIRD_COL = 'GHI‘ • What is the issue? • Row may no longer be ABC.DEF.GHI by the time update executes • Another transaction may have gotten in and updated it to ABC.DEF.XYZ • So update will receive "row not found"
  • 21. #IDUG 21 What should an application programmer do • Use programming techniques which avoid possible data currency exposures and access path dependencies (these sometimes occur regardless of the CURRENTDATA option) • Define cursors with their intended use • Easier to read application code • Number of ambiguous cursors can be reduced • Some queries will not allow the use of a FOR UPDATE cursor due to possible work file usage e.g., with ORDER BY • Use predicates on searched updates to enforce data currency • When a FOR UPDATE cursor cannot be used with a query it is common for application programmers to use a read only with a subsequent searched UPDATE or DELETE • It is important to use WHERE predicates to ensure that data has not changed since your cursor first selected the data • Include all columns which logically determine if the update is necessary, instead of updating based solely on the key • This is an exposure regardless of the CURRENTDATA option, but the use of CURRENTDATA(NO) can increase the exposure opportunity • Consider the use of a timestamp or a version number • Add a timestamp or version number column to a table to record the last update • Select the timestamp or version number column with the cursor • Use it as a predicate on the searched UPDATE or DELETE to ensure that an application is updating the same row
  • 22. #IDUG 22 Finding packages to safely rebind with CURRENTDATA(NO) • Must recognise that access path dependencies will inevitably occur • CURRENTDATA(YES) will not stop access path dependency and associated exposures • Access path independence and CURRENTDATA(NO) should be the goal for all applications • Can safely rebind packages that use only true read-only cursors with CURRENTDATA(NO)
  • 24. #IDUG John Campbell DB2 for z/OS Development campbelj@uk.ibm.com Session 6007 Using RELEASE(DEALLOCATE) and Painful Lessons to be Learned on DB2 Locking