Oracle deadlock graphWhat is a deadlock?Get list of all tables in Oracle?How do I limit the number of rows returned by an Oracle query after ordering?Oracle Deadlock when Hibernate application loading data for readonly useDifference between a user and a schema in Oracle?Oracle: If Table ExistsOptimistic locking on writes in OracleHow to create id with AUTO_INCREMENT on Oracle?SQL 2016 Standard SP1 - DEADLOCK on same SPID (Exchange Event)Unable to replicate java.sql.SQLException: ORA-00060: deadlock detected while waiting for resource
Would "lab meat" be able to feed a much larger global population
What happens if I start too many background jobs?
How can I get a job without pushing my family's income into a higher tax bracket?
Point of the the Dothraki's attack in GoT S8E3?
Catholic vs Protestant Support for Nazism in Germany
What happens to the Time Stone
Returning the outputs of a nested structure
Do I have to make someone coauthor if he/she solves a problem in StackExchange, asked by myself, which is later used in my paper?
Are we obligated to aspire to be Talmidei Chachamim?
Identifying a transmission to myself
Upside-Down Pyramid Addition...REVERSED!
What does this colon mean? It is not labeling, it is not ternary operator
Selecting a secure PIN for building access
In Endgame, why were these characters still around?
How do I tell my manager that his code review comment is wrong?
Can fracking help reduce CO2?
Unknowingly ran an infinite loop in terminal
Enumerate Derangements
How would adding a darkvision racial trait to Dragonborn affect balance?
What actually is the vector of angular momentum?
Is one octave above tonic also considered as tonic?
My ID is expired, can I fly to the Bahamas with my passport?
How can I support myself financially as a 17 year old with a loan?
Identifying my late father's D&D stuff found in the attic
Oracle deadlock graph
What is a deadlock?Get list of all tables in Oracle?How do I limit the number of rows returned by an Oracle query after ordering?Oracle Deadlock when Hibernate application loading data for readonly useDifference between a user and a schema in Oracle?Oracle: If Table ExistsOptimistic locking on writes in OracleHow to create id with AUTO_INCREMENT on Oracle?SQL 2016 Standard SP1 - DEADLOCK on same SPID (Exchange Event)Unable to replicate java.sql.SQLException: ORA-00060: deadlock detected while waiting for resource
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
We get a deadlock in one of our merge statement
merge into target tt using
(select * from global_tmp_tb) hh
on( hh.pk=tt.pk)
when matched then
update
when not matched then
insert
---------Blocker(s)-------- ---------Waiter(s)---------
process session holds waits process session holds waits
2404 6309 X 2407 6502 S
2407 6502 X 2405 6372 S
2405 6372 X 1409 4103 S
1409 4103 X 2404 6309 S
Rows waited on:
Session 6309: obj - rowid = 0033DA34 - AAM9o0ACfAAOH6cAAA
(dictionary objn - 3398196, file - 159, block - 3702428, slot - 0)
Session 6502: obj - rowid = 0033D9B0 - AAM9mwACfAAOJaXAAA
(dictionary objn - 3398064, file - 159, block - 3708567, slot - 0)
Session 6372: obj - rowid = 0033D9B0 - AAM9mwACfAAOJhzAAA
(dictionary objn - 3398064, file - 159, block - 3709043, slot - 0)
Session 4103: obj - rowid = 0033DDD0 - AAM93QACfAAOLC5AAA
(dictionary objn - 3399120, file - 159, block - 3715257, slot - 0)
It is likely that the merge insert will cause the deadlock, so let say its update
In particular, it is waiting a S lock which is a shared lock.
But if its deadlocking on update then why it is not exclusive lock ?
Also what is all these mean
Session 4103: obj - rowid = 0033DDD0 - AAM93QACfAAOLC5AAA
(dictionary objn - 3399120, file - 159, block - 3715257, slot - 0)
What data dictionary object I need to query
oracle concurrency parallel-processing
add a comment |
We get a deadlock in one of our merge statement
merge into target tt using
(select * from global_tmp_tb) hh
on( hh.pk=tt.pk)
when matched then
update
when not matched then
insert
---------Blocker(s)-------- ---------Waiter(s)---------
process session holds waits process session holds waits
2404 6309 X 2407 6502 S
2407 6502 X 2405 6372 S
2405 6372 X 1409 4103 S
1409 4103 X 2404 6309 S
Rows waited on:
Session 6309: obj - rowid = 0033DA34 - AAM9o0ACfAAOH6cAAA
(dictionary objn - 3398196, file - 159, block - 3702428, slot - 0)
Session 6502: obj - rowid = 0033D9B0 - AAM9mwACfAAOJaXAAA
(dictionary objn - 3398064, file - 159, block - 3708567, slot - 0)
Session 6372: obj - rowid = 0033D9B0 - AAM9mwACfAAOJhzAAA
(dictionary objn - 3398064, file - 159, block - 3709043, slot - 0)
Session 4103: obj - rowid = 0033DDD0 - AAM93QACfAAOLC5AAA
(dictionary objn - 3399120, file - 159, block - 3715257, slot - 0)
It is likely that the merge insert will cause the deadlock, so let say its update
In particular, it is waiting a S lock which is a shared lock.
But if its deadlocking on update then why it is not exclusive lock ?
Also what is all these mean
Session 4103: obj - rowid = 0033DDD0 - AAM93QACfAAOLC5AAA
(dictionary objn - 3399120, file - 159, block - 3715257, slot - 0)
What data dictionary object I need to query
oracle concurrency parallel-processing
add a comment |
We get a deadlock in one of our merge statement
merge into target tt using
(select * from global_tmp_tb) hh
on( hh.pk=tt.pk)
when matched then
update
when not matched then
insert
---------Blocker(s)-------- ---------Waiter(s)---------
process session holds waits process session holds waits
2404 6309 X 2407 6502 S
2407 6502 X 2405 6372 S
2405 6372 X 1409 4103 S
1409 4103 X 2404 6309 S
Rows waited on:
Session 6309: obj - rowid = 0033DA34 - AAM9o0ACfAAOH6cAAA
(dictionary objn - 3398196, file - 159, block - 3702428, slot - 0)
Session 6502: obj - rowid = 0033D9B0 - AAM9mwACfAAOJaXAAA
(dictionary objn - 3398064, file - 159, block - 3708567, slot - 0)
Session 6372: obj - rowid = 0033D9B0 - AAM9mwACfAAOJhzAAA
(dictionary objn - 3398064, file - 159, block - 3709043, slot - 0)
Session 4103: obj - rowid = 0033DDD0 - AAM93QACfAAOLC5AAA
(dictionary objn - 3399120, file - 159, block - 3715257, slot - 0)
It is likely that the merge insert will cause the deadlock, so let say its update
In particular, it is waiting a S lock which is a shared lock.
But if its deadlocking on update then why it is not exclusive lock ?
Also what is all these mean
Session 4103: obj - rowid = 0033DDD0 - AAM93QACfAAOLC5AAA
(dictionary objn - 3399120, file - 159, block - 3715257, slot - 0)
What data dictionary object I need to query
oracle concurrency parallel-processing
We get a deadlock in one of our merge statement
merge into target tt using
(select * from global_tmp_tb) hh
on( hh.pk=tt.pk)
when matched then
update
when not matched then
insert
---------Blocker(s)-------- ---------Waiter(s)---------
process session holds waits process session holds waits
2404 6309 X 2407 6502 S
2407 6502 X 2405 6372 S
2405 6372 X 1409 4103 S
1409 4103 X 2404 6309 S
Rows waited on:
Session 6309: obj - rowid = 0033DA34 - AAM9o0ACfAAOH6cAAA
(dictionary objn - 3398196, file - 159, block - 3702428, slot - 0)
Session 6502: obj - rowid = 0033D9B0 - AAM9mwACfAAOJaXAAA
(dictionary objn - 3398064, file - 159, block - 3708567, slot - 0)
Session 6372: obj - rowid = 0033D9B0 - AAM9mwACfAAOJhzAAA
(dictionary objn - 3398064, file - 159, block - 3709043, slot - 0)
Session 4103: obj - rowid = 0033DDD0 - AAM93QACfAAOLC5AAA
(dictionary objn - 3399120, file - 159, block - 3715257, slot - 0)
It is likely that the merge insert will cause the deadlock, so let say its update
In particular, it is waiting a S lock which is a shared lock.
But if its deadlocking on update then why it is not exclusive lock ?
Also what is all these mean
Session 4103: obj - rowid = 0033DDD0 - AAM93QACfAAOLC5AAA
(dictionary objn - 3399120, file - 159, block - 3715257, slot - 0)
What data dictionary object I need to query
oracle concurrency parallel-processing
oracle concurrency parallel-processing
asked Mar 22 at 21:00
MookayamaMookayama
4682522
4682522
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Locking is very complicated and I admit there's lots about it I don't understand. A MERGE
is a combination of a SELECT
statement (the USING
clause) and an INSERT
and/or an UPDATE
statement. My guess is:
- The share (S) locks are those sessions locking the rows in a non-exclusive mode because they've checked the table for the source data of the
MERGE
in theUSING
clause of the statement. - The exclusive (X) locks are for an update that's been made on the table.
So I think basically what's happening is:
- Session A gets the source data in
global_tmp_tb
and locks the rows in share mode. - Session B gets the source data in
global_tmp_tb
and locks the rows in share mode. Since share mode is not exclusive, two sessions can both have a share row lock with no problem. - Session A updates row 1 based on the ON clause. This gets an exclusive lock on the row.
- Session B updates row 2 based on the ON clause. This gets an exclusive lock on the row.
- Session A tries to update row 2. It can't because session B has it locked in row-exclusive mode.
- Session B tries to update row 1. It can't because session A has it locked in row-exclusive mode.
- Boom, deadlock.
Do you really need to get every table in global_tmp_tb
for all these sessions? Can you narrow down the source data for each session with a WHERE
clause?
Could you do select * from global_tmp_tb for update
prior to your MERGE
to get around this? This would mean that access to the merge is serialized and each session has to go in order, which may be bad.
The issue is we are 99% sure the data is partitioned correctly which mean session-1 will only update row-1 and session-2 only update row-2
– Mookayama
Mar 23 at 3:12
community.oracle.com/thread/4208618
– Mookayama
Mar 23 at 3:13
actually, when i read the graph more carefully, it seems the session is waiting on a shared lock not exclusive lock which mean its not an update/update contention. according to the above comment from the OTN forum
– Mookayama
Mar 23 at 3:13
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307708%2foracle-deadlock-graph%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Locking is very complicated and I admit there's lots about it I don't understand. A MERGE
is a combination of a SELECT
statement (the USING
clause) and an INSERT
and/or an UPDATE
statement. My guess is:
- The share (S) locks are those sessions locking the rows in a non-exclusive mode because they've checked the table for the source data of the
MERGE
in theUSING
clause of the statement. - The exclusive (X) locks are for an update that's been made on the table.
So I think basically what's happening is:
- Session A gets the source data in
global_tmp_tb
and locks the rows in share mode. - Session B gets the source data in
global_tmp_tb
and locks the rows in share mode. Since share mode is not exclusive, two sessions can both have a share row lock with no problem. - Session A updates row 1 based on the ON clause. This gets an exclusive lock on the row.
- Session B updates row 2 based on the ON clause. This gets an exclusive lock on the row.
- Session A tries to update row 2. It can't because session B has it locked in row-exclusive mode.
- Session B tries to update row 1. It can't because session A has it locked in row-exclusive mode.
- Boom, deadlock.
Do you really need to get every table in global_tmp_tb
for all these sessions? Can you narrow down the source data for each session with a WHERE
clause?
Could you do select * from global_tmp_tb for update
prior to your MERGE
to get around this? This would mean that access to the merge is serialized and each session has to go in order, which may be bad.
The issue is we are 99% sure the data is partitioned correctly which mean session-1 will only update row-1 and session-2 only update row-2
– Mookayama
Mar 23 at 3:12
community.oracle.com/thread/4208618
– Mookayama
Mar 23 at 3:13
actually, when i read the graph more carefully, it seems the session is waiting on a shared lock not exclusive lock which mean its not an update/update contention. according to the above comment from the OTN forum
– Mookayama
Mar 23 at 3:13
add a comment |
Locking is very complicated and I admit there's lots about it I don't understand. A MERGE
is a combination of a SELECT
statement (the USING
clause) and an INSERT
and/or an UPDATE
statement. My guess is:
- The share (S) locks are those sessions locking the rows in a non-exclusive mode because they've checked the table for the source data of the
MERGE
in theUSING
clause of the statement. - The exclusive (X) locks are for an update that's been made on the table.
So I think basically what's happening is:
- Session A gets the source data in
global_tmp_tb
and locks the rows in share mode. - Session B gets the source data in
global_tmp_tb
and locks the rows in share mode. Since share mode is not exclusive, two sessions can both have a share row lock with no problem. - Session A updates row 1 based on the ON clause. This gets an exclusive lock on the row.
- Session B updates row 2 based on the ON clause. This gets an exclusive lock on the row.
- Session A tries to update row 2. It can't because session B has it locked in row-exclusive mode.
- Session B tries to update row 1. It can't because session A has it locked in row-exclusive mode.
- Boom, deadlock.
Do you really need to get every table in global_tmp_tb
for all these sessions? Can you narrow down the source data for each session with a WHERE
clause?
Could you do select * from global_tmp_tb for update
prior to your MERGE
to get around this? This would mean that access to the merge is serialized and each session has to go in order, which may be bad.
The issue is we are 99% sure the data is partitioned correctly which mean session-1 will only update row-1 and session-2 only update row-2
– Mookayama
Mar 23 at 3:12
community.oracle.com/thread/4208618
– Mookayama
Mar 23 at 3:13
actually, when i read the graph more carefully, it seems the session is waiting on a shared lock not exclusive lock which mean its not an update/update contention. according to the above comment from the OTN forum
– Mookayama
Mar 23 at 3:13
add a comment |
Locking is very complicated and I admit there's lots about it I don't understand. A MERGE
is a combination of a SELECT
statement (the USING
clause) and an INSERT
and/or an UPDATE
statement. My guess is:
- The share (S) locks are those sessions locking the rows in a non-exclusive mode because they've checked the table for the source data of the
MERGE
in theUSING
clause of the statement. - The exclusive (X) locks are for an update that's been made on the table.
So I think basically what's happening is:
- Session A gets the source data in
global_tmp_tb
and locks the rows in share mode. - Session B gets the source data in
global_tmp_tb
and locks the rows in share mode. Since share mode is not exclusive, two sessions can both have a share row lock with no problem. - Session A updates row 1 based on the ON clause. This gets an exclusive lock on the row.
- Session B updates row 2 based on the ON clause. This gets an exclusive lock on the row.
- Session A tries to update row 2. It can't because session B has it locked in row-exclusive mode.
- Session B tries to update row 1. It can't because session A has it locked in row-exclusive mode.
- Boom, deadlock.
Do you really need to get every table in global_tmp_tb
for all these sessions? Can you narrow down the source data for each session with a WHERE
clause?
Could you do select * from global_tmp_tb for update
prior to your MERGE
to get around this? This would mean that access to the merge is serialized and each session has to go in order, which may be bad.
Locking is very complicated and I admit there's lots about it I don't understand. A MERGE
is a combination of a SELECT
statement (the USING
clause) and an INSERT
and/or an UPDATE
statement. My guess is:
- The share (S) locks are those sessions locking the rows in a non-exclusive mode because they've checked the table for the source data of the
MERGE
in theUSING
clause of the statement. - The exclusive (X) locks are for an update that's been made on the table.
So I think basically what's happening is:
- Session A gets the source data in
global_tmp_tb
and locks the rows in share mode. - Session B gets the source data in
global_tmp_tb
and locks the rows in share mode. Since share mode is not exclusive, two sessions can both have a share row lock with no problem. - Session A updates row 1 based on the ON clause. This gets an exclusive lock on the row.
- Session B updates row 2 based on the ON clause. This gets an exclusive lock on the row.
- Session A tries to update row 2. It can't because session B has it locked in row-exclusive mode.
- Session B tries to update row 1. It can't because session A has it locked in row-exclusive mode.
- Boom, deadlock.
Do you really need to get every table in global_tmp_tb
for all these sessions? Can you narrow down the source data for each session with a WHERE
clause?
Could you do select * from global_tmp_tb for update
prior to your MERGE
to get around this? This would mean that access to the merge is serialized and each session has to go in order, which may be bad.
answered Mar 23 at 0:22
eaolsoneaolson
8,91563247
8,91563247
The issue is we are 99% sure the data is partitioned correctly which mean session-1 will only update row-1 and session-2 only update row-2
– Mookayama
Mar 23 at 3:12
community.oracle.com/thread/4208618
– Mookayama
Mar 23 at 3:13
actually, when i read the graph more carefully, it seems the session is waiting on a shared lock not exclusive lock which mean its not an update/update contention. according to the above comment from the OTN forum
– Mookayama
Mar 23 at 3:13
add a comment |
The issue is we are 99% sure the data is partitioned correctly which mean session-1 will only update row-1 and session-2 only update row-2
– Mookayama
Mar 23 at 3:12
community.oracle.com/thread/4208618
– Mookayama
Mar 23 at 3:13
actually, when i read the graph more carefully, it seems the session is waiting on a shared lock not exclusive lock which mean its not an update/update contention. according to the above comment from the OTN forum
– Mookayama
Mar 23 at 3:13
The issue is we are 99% sure the data is partitioned correctly which mean session-1 will only update row-1 and session-2 only update row-2
– Mookayama
Mar 23 at 3:12
The issue is we are 99% sure the data is partitioned correctly which mean session-1 will only update row-1 and session-2 only update row-2
– Mookayama
Mar 23 at 3:12
community.oracle.com/thread/4208618
– Mookayama
Mar 23 at 3:13
community.oracle.com/thread/4208618
– Mookayama
Mar 23 at 3:13
actually, when i read the graph more carefully, it seems the session is waiting on a shared lock not exclusive lock which mean its not an update/update contention. according to the above comment from the OTN forum
– Mookayama
Mar 23 at 3:13
actually, when i read the graph more carefully, it seems the session is waiting on a shared lock not exclusive lock which mean its not an update/update contention. according to the above comment from the OTN forum
– Mookayama
Mar 23 at 3:13
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55307708%2foracle-deadlock-graph%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown