Mohamed Houri’s Oracle Notes

March 14, 2011

Deadlock – Part 1: bitmap Index

Filed under: Deadlock — hourim @ 7:40 pm

How many times I heard and read that it is absolutely not conceivable to create bitmap indexes into a heavy OnLine Transactional Process (OLTP) application into tables that are subject to concurrent DML operations. The main reason for that is because of the deadlock threat the bitmap indexes can throw into this kind of applications. The purpose of this article, in its first part, is mainly to show how to identify, via the deadlock graph that the deadlock you are experiencing is due to a bitmap index in an OLTP system.

Here below is a deadlock graph automatically generated from a real life OLTP production application I have been asked to have a close look to:

[Transaction Deadlock]
The following deadlock is not an ORACLE error. It is a
deadlock due to user error in the design of an application
or from issuing incorrect ad-hoc SQL. The following
information may aid in determining the deadlock:

Deadlock graph:
---------Blocker(s)--------  ---------Waiter(s)---------
Resource Name          process session holds waits  process session holds waits
TX-0017000b-0000a507        26     164     X             50     160           S
TX-0037000e-000081cc        50     160     X             26     164           S

This is the most fundamental and the first information that should retain your attention: we have two sessions 164 and 160 dead-locking each other. They are both Transaction Enqueues (TX) held on X mode and waited on S mode

Immediately when you see TX held on X mode and waited on S mode you can think of one of the following possibilities which triggered this deadlock

1.       Existence of Bitmap indexes into your OLTP application

2.       Primary key or unique key constraint overlapping during insert statement

The next bit of information within the deadlock graph will help you identifying the real cause as I did in this application. You need to look to the Sql statements done by the two sessions as shown below:

Information on the OTHER waiting sessions:
Session 160:
pid=50 serial=9778 audsid=49307085 user: 54/S102
O/S info: user: SYS_XXX-ZZZ, term: wyannhhF103, ospid: 6592:3660, machine: lkti\HJKULOO03
program: xye.exe
application name: xye.exe, hash value=2799981571

Current SQL Statement:
DELETE xxx_real_life_table WHERE xxx_ID = :B1
End of information on OTHER waiting sessions.

Current SQL statement for this session:
INSERT INTO yyy_real_life_table (yyy_ID ,DET_ID,xxx_ID) VALUES (yyy__SEQ.NEXTVAL ,0 ,:B23 )

----- PL/SQL Call Stack -----

As far as session 160 was doing a delete operation while session 164 was doing an insert operation it is impossible that for this deadlock to be caused by primary key or unique key overlapping values. It remains for me only to check the existence of the bitmap indexes into this application.> SELECT count(1)
2    FROM all_indexes
3   WHERE index_type = 'BITMAP';


I then have dropped those bitmap indexes making the deadlock disappear. I have also asked the local developer to explain me why they’ve created bitmap indexes into tables subject to heavy DML operation; their answer was that all those indexes are on a flag processed which have only two values : Y and N and they told me this is why they opted for this kind of bitmap indexes. My answer for them was this:

1 Comment »

  1. I every time used to study post in news papers but now as I am a user of net therefore from now
    I am using net for posts, thanks to web.

    Comment by Zara — December 5, 2012 @ 10:45 pm | Reply

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Create a free website or blog at

Tony's Oracle Tips

Tony Hasler's light hearted approach to learning about Oracle

Richard Foote's Oracle Blog

Focusing Specifically On Oracle Indexes, Database Administration and Some Great Music

Hatem Mahmoud Oracle's blog

Just another Oracle blog : Database topics and techniques

Mohamed Houri’s Oracle Notes

Qui se conçoit bien s’énonce clairement

Oracle Diagnostician

Performance troubleshooting as exact science

Raheel's Blog

Things I have learnt as Oracle DBA

Coskan's Approach to Oracle

What I learned about Oracle

So Many Oracle Manuals, So Little Time

“Books to the ceiling, Books to the sky, My pile of books is a mile high. How I love them! How I need them! I'll have a long beard by the time I read them”—Lobel, Arnold. Whiskers and Rhymes. William Morrow & Co, 1988.

Carlos Sierra's Tools and Tips

Tools and Tips for Oracle Performance and SQL Tuning

Oracle Scratchpad

Just another Oracle weblog


Dominic Brooks on Oracle Performance, Tuning, Data Quality & Sensible Design ... (Now with added Sets Appeal)

%d bloggers like this: