Q
Problem solve Get help with specific problems with your technologies, process and projects.

How Oracle handles concurrent queries

How does Oracle handle two concurrent queries, one for an update and one for deletion of tables simultaneously...

?

Oracle will lock the row(s) being effected by the first process to request the lock, and the second operation will wait until the first operation finishes. At that time, the second operation will execute. There's really no such thing as "concurrent" in the sense that one transaction will get to the data first and the other will have to wait for it.

If the two operations do not effect the same rows, then they can both execute at the same time. Oracle locks at the row level so if you lock a row to update it, and at the same time another session tries to delete a different row, both will succeed. Only when you try to do manipulation of the same row will the locking mechanism hold one session until the first one to achieve the lock completes.

For More Information

  • What do you think about this answer? E-mail the editors at editor@searchDatabase.com with your feedback.
  • The Best Oracle Web Links: tips, tutorials, scripts, and more.
  • Have an Oracle or SQL tip to offer your fellow DBAs and developers? The best tips submitted will receive a cool prize. Submit your tip today!
  • Ask your technical Oracle and SQL questions -- or help out your peers by answering them -- in our live discussion forums.
  • Ask the Experts yourself: Our SQL, database design, Oracle, SQL Server, DB2, metadata, object-oriented and data warehousing gurus are waiting to answer your toughest questions.

This was last published in February 2002

Dig Deeper on Oracle and SQL

PRO+

Content

Find more PRO+ content and other member only offers, here.

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close