GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Oracle  >  Database Administration
Go To First  |  Previous Question  |  Next Question 
 Database Administration  |  Question 55 of 231    Print  
What is a deadlock and Explain
A deadlock is a condition where two or more users are waiting for data locked by each other. Oracle automatically detects a deadlock and resolves them by rolling back one of the statements involved in the deadlock, thus releasing one set of data locked by that statement. Statement rolled back is usually the one which detects the deadlock. Deadlocks are mostly caused by explicit locking because oracle does not do lock escalation and does not use read locks. Multitable deadlocks can be avoided by locking the tables in same order in all the applications, thus precluding a deadlock.


  
Total Answers and Comments: 2 Last Update: August 17, 2007   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
November 21, 2005 05:11:06   #1  
shiju k daniel        

RE: What is a deadlock and Explain
System waiting for an event that may or may not happens and can be rectified using round robin algorithm which implemented internally by operating systems
 
Is this answer useful? Yes | No
August 17, 2007 18:55:53   #2  
satyam_Ora Member Since: July 2007   Contribution: 29    

RE: What is a deadlock and Explain
Deadlock occurs when two or more users are waiting for data locked by each other. When this happens these users are stuck (deadly embraced) and cannot continue processing.

Oracle automatically detects deadlocks and resolves them by rolling back one of the statements involved in the deadlock thus releasing one set of data locked by that statement. The session that is rolled back will observe Oracle error:
ORA-00060: deadlock detected while waiting for resource. Oracle will also write out a trace file with detailed information to the database's UDUMP directory.

Multi-table deadlocks can be avoided by locking tables in same order (in all applications) thus preventing a deadlock condition.
For example session1 lock table: emp then dept; session2: emp then dept. If this is not possible your application should check for ORA-60 errors and restart the rolled back transactions.

Regards
Satyam


 
Is this answer useful? Yes | No

 Related Questions

Latest Answer : The database is actually a collection of objects, which are made up of tablespaces and each tablespace must have datafile associate with it. The tablespace cannot be created without datafile. The tablespaces are two kind physical and logical.The logical ...

Latest Answer : SGA+Background Process = InstanceAs soon as user process starts and server process takes control from user process, instance created with help of background processes and most important background processes are dbwriter, logwriter, checkpoint, SMON, PMON ...

A deadlock is a condition where two or more users are waiting for data locked by each other. Oracle automatically detects a deadlock and resolves them by rolling back one of the statements involved in 
Latest Answer :  Deadlock occurs when two or more users are waiting for data locked by each other. When this happens, these users are stuck (deadly embraced) and cannot continue processing. Oracle automatically detects deadlocks and resolves them by rolling back ...

 A  database  instance  (Server) is a set of memory structure and background processes that access a set of database files. The process can be shared by all users. The  
Latest Answer : Database instance(server) is the combination of memory structure and background process. It's a way to connect to the oracle database. ...

 Two  processes wating to update the rows of a table which are locked by the other process then deadlock arises. In  a  database  environment  this will often happen 
Latest Answer : Oracle automatically detect deadlock , but not occar ...

Latest Answer : PGA Program global area Contains  Session variables ,Stack space,Cursor status ,Sort Areas ...

Latest Answer : Function-based indexes can use any Function or Object method that is declared as repeatable. Queries using expressions can use the index. Ex:- CREATE INDEX sales_margin_inx  ON sales(revenue - cost);   Sql> SELECT ...

Virtual Indexes are another undocumented feature used by Oracle. Virtual indexes, as the name suggests are pseudo-indexes that will not behave the same way that normal indexes behave, and are meant for 
View Question | Asked by : David

Latest Answer : Export is one of taking backup.  In export backup you can specify many parameters in par file or at command line.  One of the parameter is statistics=y or n.  If you specify y it is going to export statistics generated in the database placed ...

How you spend a day as a DBA. Explain DBA activities in detail. 
View Question | Asked by : Pragati.rch


 Sponsored Links

 
Related Articles

Querying Data with Oracle XQuery

Querying Data with Oracle XQuery Starting with Oracle Database 10g Release 2 you can take advantage of a full featured native XQuery engine integrated with the database With Oracle XQuery you can accomplish various tasks involved in developing PHP Oracle XML applications operating on any kind of dat
 

Using Oracle XML DB Repository

Using Oracle XML DB Repository Another variation on accessing and manipulating XML content stored in Oracle database is provided by Oracle XML DB repository which is an essential component of Oracle XML DB mosgoogle NOTE Oracle XML DB repository also known as XML repository is a hierarchically organ
 

Using XMLType for Handling XML Data in the Database

Using XMLType for Handling XML Data in the Database Being an object type XMLType can not only be used to store XML data in the database but also to operate on that data via its built in methods Regardless of the storage model you choose XMLType provides a set of XML specific methods to operate on XM
 

Using Oracle Database for Storing, Modifying, and Retrieving XML Data

Using Oracle Database for Storing Modifying and Retrieving XML Data With Oracle XML DB you have various XML storage and XML processing options allowing you to achieve the required level of performance and scalability One of the most interesting things about Oracle XML DB is that it allows you to per
 

Performing XSLT Transformations inside the Database

Performing XSLT Transformations inside the Database Now that you have the employees XSL stylesheet stored in the database and the xmlusr schema is permitted to access the hr employees table you can create a script that will instruct the database to build an HTML page based on the data stored in hr e
 

Moving All the XML Processing into the Database

Moving All the XML Processing into the Database In the preceding example the database server performs only a part of the XML processing while the rest is still performed by the PHP engine Specifically the database server generates an employees XML document based on the records from the hr employees
 

Performing XML Processing inside the Database

Performing XML Processing inside the Database When building XML enabled applications on top of Oracle there are many advantages to performing the XML processing inside the database when compared to performing it on the client The key advantages to perform XML processing inside the database are as fo
 

XML Processing in PHP and Oracle Applications

Processing XML in PHP Oracle Applications As mentioned there are two alternatives when it comes to performing XML processing in your PHP Oracle application You can perform any required XML processing using either PHP s XML extensions or PEAR XML packages or Oracle s XML features mosgoogle In the fol
 

PHP Oracle Web Development

PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax The book is written by Yuli Vaseliev a well known author of different web development and programming books PHP Oracle Web Development Data processing Security Caching XML Web Services and Ajax is a good starting b
 

Getting Started with Oracle and ODP.NET

ODP NET Developer’ s Guide by Jagadish Chatarji Pulakhandam Sunitha Paruchuri A practical guide for developers working with the Oracle Data Provider for NET and the Oracle Developer Tools for Visual Studio 2005 Application development with ODP NET Dealing with XML DB using ODP NET Oracle
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape