ORA-00060: deadlock detected while waiting for resource
Once Oracle detects a conflict between transactions, it will automatically stop the transaction of one of the sessions so they will not block each other for ever.
You will find a trace file in the user_dump_dest containing the objects involved.
eg:
First setup 2 tables:Now you need to have 2 sessions (S1 and S2)
SQL> create table t1(n number);
Table created.
SQL> create table t2(n number);
Table created.
SQL> insert into t1 values(1);
1 row created.
SQL> insert into t2 values(2);
1 row created.
SQL> commit;
Commit complete.
Timestamp session actionA common cause of deadlocks are missing indexes on foreign keys. You can use following query to check for these:
T1 S1 update t1 set n=3;
T2 S2 update t2 set n=4;
T3 S2 update t1 set n=2; --> This will wait until S1 commits the action done in T1
T4 S1 update t2 set n=4; --> This will wait until S2 commits the action done in T2
Now S2 is waiting for S1 to commit the transaction done in T1
and S1 is waiting for S2 to commit the transaction done in T2
This is a deadlock situation. After a while, S2 will time out with following error:
SQL> update t1 set n=2;
update t1 set n=2
*
ERROR at line 1:
ORA-00060: deadlock detected while waiting for resource
Remark: Only the action done at T3 will timeout, the lock set by S2 in T2 is still there.
S1 will still wait for the commit/rollback of the transaction done in T2
select
c.owner
, c.table_name
, c.constraint_name
from
dba_constraints c
where not exists
( select 1
from
dba_cons_columns cc
, dba_ind_columns ic
where cc.owner=c.owner
and cc.table_name=c.table_name
and cc.constraint_name=c.constraint_name
and cc.owner=ic.table_owner
and cc.table_name=ic.table_name
and cc.column_name = ic.column_name
)
and c.constraint_type = 'R'
Welcome to our forum for Oracle error: ORA-00060 Add your own message
the problem of mututaion. Can any one plz solve this.
Thanks in advance,
Santhosh
I'm getting the following error "Error Message :ORA-00060: deadlock detected while waiting for resource" while updating the status of transaction. I've got this error in two servers. While ione server has timed out one of the transactions and continued to process normally as per the above explanation, in another server the MDB listener was stopped and my messages were not processed.
the only solution I have is to restart the application server instance.
Is there any permanent solution to deadlock issue?
I would really appreciate any kind of help.
Thanks
Check for those trace files, they will contain the offending sql's.
Try to map these statements to your code, and see if there is a potential problem which can cause this deadlock situation
we have almost the same problem with 'sunil' but this error not coming from oracle10g db itself but from our client application. our db cluster server (RX6600series running on RHEL4.6 itanium, oracle10g patch4) did not have any error message at all until the team asked me to restart (1, services, later then 2, hardware)..
so far, our partners 'the vendor' for client application said it is the bug for oracle10g. what we do is expand the index FK size, the problem solve..but was it REALLY SOLVE?
any idea what happen? Tq.
Without trace files it is difficult to tell what the exact problem is.
because your application vendor refers to a bug, you might have hit the bug. When patched, it is likely that your problem will be solved.
Do you mind to share the bug number?
Also a common problem with deadlocks are missing indexes on foreign keys, maybe your application vendor was refering to this problem?
Add your message
If you need more information about this particular error message, you can leave a forum message.
We are replying to this message whenever we have some spare time, so please do not consider this as a private 'solve my critical issue asap' service.
Should you need professional Oracle Assistance to make your project a success, please have a look at our consultancy services.
In order to prevent automatic generation of messages, we are asking for a validation code. This code is unique and is generated every time a new message is asked.
If you do not enter the validation correctly, your message will not be recorded.
