Solved

Deadlocks , Rollbacks and Undo

Posted on 2013-11-08
4
370 Views
Last Modified: 2013-11-10
Do rollbacks have any impact on undo activity when Oracle is attempting to break a deadlock?
0
Comment
Question by:xoxomos
  • 2
4 Comments
 
LVL 15

Assisted Solution

by:Franck Pachot
Franck Pachot earned 250 total points
ID: 39635855
Hi,
Yes, when a deadlock is detected by Oracle one of the sessions is terminated (killed) and has to rollback what was done in the transaction. That reads undo, applies changes and generate redo.
Regards,
Franck.
0
 
LVL 35

Accepted Solution

by:
Mark Geerlings earned 250 total points
ID: 39636442
Oracle uses the rollback (or undo) segments to read the information that must be applied to "rollback" the uncommitted changes in one of the two sessions when a dealock occurs.  In earlier versions of Oracle (Oracle8 and earlier) there were only rollback segments.  Starting with Oracle9, the default now is to use undo segments instead, but they function similarly (at least as far as we are concerned as users of Oracle.  There are some technical differences.)

Keep in mind that deadlocks are not caused by database bugs.  They indicate application design flaws or inconsitencies.  They happen when two users (or processes) lock records from the same two tables, but in the opposite order.  For example, is user A starts by changing an order header, then tries to change some lines for that order, while user B started changing sone lines for that same order, then tries to change the order header.  At that point, the database recognizes a deadlock, and will terminate one of these sessions, and rollback the change(s) that session had made, but not saved.  This allows the other session to proceed and save its changes.
0
 
LVL 15

Expert Comment

by:Franck Pachot
ID: 39636779
Keep in mind that deadlocks are not caused by database bugs.  They indicate application design flaws or inconsitencies.
Warning: that applies only to application locks (TM table locks and TX row locks). There are a lot of bugs where a deadloack occurs for other internal locks !
0
 

Author Closing Comment

by:xoxomos
ID: 39637075
mil gracias
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.

Question has a verified solution.

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

Suggested Solutions

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video shows how to Export data from an Oracle database using the Datapump Export Utility.  The corresponding Datapump Import utility is also discussed and demonstrated.

821 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