Solved

Dead Lock detection

Posted on 2004-08-30
2
2,039 Views
Last Modified: 2008-02-01
On Oracle 8i and 9i
On UNIX

from your experience, how long does it take Oracle to detect dead locks in the db?

Thanks
0
Comment
Question by:peledc
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 7

Accepted Solution

by:
grim_toaster earned 250 total points
ID: 11940823
Dead locks should be picked up immediately, here's an example.  You will require two SQL*Plus sessions...

-- Create test data...
CREATE TABLE t1 (id NUMBER);
CREATE TABLE t2 (id NUMBER);
INSERT INTO t1 VALUES(1);
INSERT INTO t1 VALUES(2);
INSERT INTO t2 VALUES(1);
INSERT INTO t2 VALUES(2);
COMMIT;

-- Now, in session one, run...
DELETE FROM t1 WHERE id = 1;

-- Now, in session two, run...
DELETE FROM t2 WHERE id = 1;
DELETE FROM t1 WHERE id = 1;

Now, in session one, run...
DELETE FROM t2 WHERE id = 1;

Session two will now have its last statement cancelled (the transaction is not rolled back): ORA-00060: deadlock detected while waiting for resource
0
 
LVL 23

Expert Comment

by:seazodiac
ID: 11940936
DEADLOCK is a rare, serious error considered by Oracle.

so it's logged in the alert.log file.


Your comments---->how long does it take Oracle to detect dead locks in the db?

right away.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Truncate is a DDL Command where as Delete is a DML Command. Both will delete data from table, but what is the difference between these below statements truncate table <table_name> ?? delete from <table_name> ?? The first command cannot be …
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question