Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Deadlocks , Rollbacks and Undo

Posted on 2013-11-08
4
Medium Priority
?
407 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 1000 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 1000 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

Industry Leaders: 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

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.
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
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.
This video shows setup options and the basic steps and syntax for duplicating (cloning) a database from one instance to another. Examples are given for duplicating to the same machine and to different machines

704 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