Solved

Deadlocks , Rollbacks and Undo

Posted on 2013-11-08
4
358 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
Comment Utility
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 34

Accepted Solution

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

Join & Write a Comment

Article by: Swadhin
From the Oracle SQL Reference (http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/queries006.htm) we are told that a join is a query that combines rows from two or more tables, views, or materialized views. This article provides a glimps…
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 shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

744 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

12 Experts available now in Live!

Get 1:1 Help Now