Solved

Deadlocks , Rollbacks and Undo

Posted on 2013-11-08
4
399 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
[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
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Background In several of the companies I have worked for, I noticed that corporate reporting is off loaded from the production database and done mainly on a clone database which needs to be kept up to date daily by various means, be it a logical…
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 explains at a high level with the mandatory Oracle Memory processes are as well as touching on some of the more common optional ones.
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…
Suggested Courses

623 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