Thanks for the question, sahil.
Asked: October 14, 2015 - 1:02 pm UTC
Last updated: October 14, 2015 - 3:20 pm UTC
Version: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
Viewed 10K+ times! This question is
You Asked
Hi Guys,
We are updating some columns in a table. None of these columns have indexes on them, however there are two unique indexes on the table. We are calling an update statement from Abinitio to oracle DB. Statement is running in parallel(4) with default table values(INI_RANS=1, PCT_FREE=10 etc)
We have made sure none of these four parallel process will update a same row in the table. Here below is the update query:
update table_X set
Col1=:'some value',
Col2=:'some value',
Col3=:'some value',
Col4='some value'
where Col5='some value'
Value of Col5 above may fetch more than one rows in the table but all those rows will be updated by only a single parallel process only for example:
Suppose Col5 has following values:
Col5
1
2
3
4
matching records in the table_X
Row_id Col5
1 1
2 1
3 1
4 2
5 2
6 3
7 4
8 4
In this case all records(row_id=1,2,3) having Col5=1 will be updated by only one parallel process(out of total four), all records (row_id=4,5) having Col5=2 by another and only one parallel process(out of total four) and so on ....
row_id column of table_x will always be unique.
Even by making sure that no two or more parallel process tries to update a same row in the table we are getting a deadlock. Error description as follows:
[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-00030003-00013c0d 35 577 X 40 7 S
TX-0007000d-00013dfd 40 7 X 35 577 S
session 577: DID 0001-0023-00000006 session 7: DID 0001-0028-00000001
session 7: DID 0001-0028-00000001 session 577: DID 0001-0023-00000006
Rows waited on:
Session 577: no row
Session 7: no row
----- Information for the OTHER waiting sessions -----
Session 7:
sid: 7 ser: 343 audsid: 2161111 user: 165/xxxxx
flags: (0x45) USR/- flags_idl: (0x1) BSY/-/-/-/-/-
flags2: (0x40009) -/-/INC
pid: 40 O/S info: user: oracle, term: UNKNOWN, ospid: 30136
image: oracle@xxxxx
client details:
O/S info: user: xxxxx, term: , ospid: 15015
machine: xxxxx program: db-update.impl.xxxxx@xxxxxx(TNS V1-V3)
application name: db-update.impl.xxxxx@xxxxxx(TNS V1-V3), hash value=327804212
current SQL:
update table_X set
Col1=:'some value',
Col2=:'some value',
Col3=:'some value',
Col4='some value'
where Col5='some value'
SO: 0x41f22f938, type: 4, owner: xxxxxx, flag: INIT/-/-/0x00 if: 0x3 c: 0x3
proc=0x418c1e1b0, name=session, file=ksu.h LINE:12624, pg=0
(session) sid: 577 ser: 23 trans: 0x40d1541d0, creator: xxxxxx
flags: (0x45) USR/- flags_idl: (0x1) BSY/-/-/-/-/-
flags2: (0x40009) -/-/INC
DID: , short-term DID:
txn branch: (nil)
oct: 6, prv: 0, sql: 0x41d85cc00, psql: 0x41d85cc00, user: 165/xxxxxx
ksuxds FALSE at location: 0
service name: xxxxxx
client details:
O/S info: user: xxxxxx, term: , ospid: 15002
machine: ins2ipa14 program: db-update.xxxx.xxxxxxx@xxxxxxx(TNS V1-V3)
application name: db-update.xxxx.xxxxxxx@xxxxxxx(TNS V1-V3), hash value=327804212
Current Wait Stack:
0: waiting for 'enq: TX - allocate ITL entry'
name|mode=0x54580004, usn<<16 | slot=0x7000d, sequence=0x13dfd
wait_id=40428 seq_num=40429 snap_id=1
wait times: snap=6.006339 sec, exc=6.006339 sec, total=6.006339 sec
wait times: max=8.000000 sec, heur=6.006339 sec
wait counts: calls=2 os=2
in_wait=1 iflags=0x15a0
There around 4.6Millions record in the table.
I have gone through other similar kind of questions posted on your website but couldn't find any possible scenario matching ours.
Could you please let me know what is the reason of this deadlock and solution for this without making it run in serial.
and Chris said...
Rating
(1 rating)
Is this answer out of date? If it is, please let us know via a Comment