How Oracle Handles Dead Locks?
Page 1 of 1
How Oracle Handles Dead Locks?
Oracle server automatically detects dead locks. When a dead lock is detected, Oracle server will
select a victim transaction, and fail its statement that is blocked in the dead lock to break the dead
lock. The tutorial exercise below shows you an example of statements failed by Oracle server
because of dead locks:
(session 1)
SQL> connect HR/fyicenter
SQL> UPDATE fyi_links
SET notes='Session 1'
WHERE id=101;
1 row updated.
(session 2)
SQL> connect HR/fyicenter
SQL> UPDATE fyi_links
SET notes='Session 2'
WHERE id=110;
1 row updated.
SQL> UPDATE fyi_links
SET notes='Session 2'
WHERE id=101;
(blocked by lock on row id=101)
SQL> UPDATE fyi_links
SET notes='Session 1'
WHERE id=110;
(blocked by lock on row id=110)
ORA-00060: deadlock detected
while waiting for resource
(statement failed)
Oracle DBA FAQ - Managing Oracle User Accounts, Schema and Privileges
A collection of 23 FAQs on Oracle user account, schema and privileges. Clear answers are
provided with tutorial exercises on creating user accounts, granting privileges for session
connections, granting privileges for creating tables and inserting rows
select a victim transaction, and fail its statement that is blocked in the dead lock to break the dead
lock. The tutorial exercise below shows you an example of statements failed by Oracle server
because of dead locks:
(session 1)
SQL> connect HR/fyicenter
SQL> UPDATE fyi_links
SET notes='Session 1'
WHERE id=101;
1 row updated.
(session 2)
SQL> connect HR/fyicenter
SQL> UPDATE fyi_links
SET notes='Session 2'
WHERE id=110;
1 row updated.
SQL> UPDATE fyi_links
SET notes='Session 2'
WHERE id=101;
(blocked by lock on row id=101)
SQL> UPDATE fyi_links
SET notes='Session 1'
WHERE id=110;
(blocked by lock on row id=110)
ORA-00060: deadlock detected
while waiting for resource
(statement failed)
Oracle DBA FAQ - Managing Oracle User Accounts, Schema and Privileges
A collection of 23 FAQs on Oracle user account, schema and privileges. Clear answers are
provided with tutorial exercises on creating user accounts, granting privileges for session
connections, granting privileges for creating tables and inserting rows
Similar topics
» How Data Locks Are Respected?
» How To View Existing Locks on the Database?
» What Is Oracle?
» What Is an Oracle Tablespace?
» What Is an Oracle Database?
» How To View Existing Locks on the Database?
» What Is Oracle?
» What Is an Oracle Tablespace?
» What Is an Oracle Database?
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
Sun Jan 31, 2010 12:35 am by Micheal
» Accessing tables of other users in SQL
Sun Jan 31, 2010 12:34 am by Micheal
» Grouping commands in SQL
Sun Jan 31, 2010 12:32 am by Micheal
» Operations on Result Sets in SQL
Sun Jan 31, 2010 12:31 am by Micheal
» Subqueries in SQL
Sun Jan 31, 2010 12:30 am by Micheal
» Joining Relations in SQL
Sun Jan 31, 2010 12:28 am by Micheal
» Delete comand in SQL
Sun Jan 31, 2010 12:27 am by Micheal
» Update command in SQL
Sun Jan 31, 2010 12:26 am by Micheal
» Insert command in SQL
Sun Jan 31, 2010 12:23 am by Micheal