Solved

Dead Lock detection

Posted on 2004-08-30
2
2,032 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
2 Comments
 
LVL 7

Accepted Solution

by:
grim_toaster earned 250 total points
Comment Utility
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
Comment Utility
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
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.
This video shows syntax for various backup options while discussing how the different basic backup types work.  It explains how to take full backups, incremental level 0 backups, incremental level 1 backups in both differential and cumulative mode a…

763 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now