Solved

Dead Lock detection

Posted on 2004-08-30
2
2,037 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Developer 6 75
Help on model clause 5 47
best datatype for oracle table email creation 8 74
How to create an alias for a column name in ORACLE sql ? 2 45
Working with Network Access Control Lists in Oracle 11g (part 2) Part 1: http://www.e-e.com/A_8429.html Previously, I introduced the basics of network ACL's including how to create, delete and modify entries to allow and deny access.  For many…
How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

735 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