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

Rows locked by which user

I am trying to find out which rows are being locked by which user. I have two users: user1 is doing a select * from emp where empno=7369 for update nowait; and user2 is trying the same query and of course he will get an exception, resource is busy. How can user2 be notified that user1 is locking the record?

I am trying to find out which rows are being locked by which user. I have two users: user1 is doing a select * from emp where empno=7369 for update nowait; and user2 is trying the same query and of course he will get an exception, resource is busy. How can user2 be notified that user1 is locking the record?
The only way to see is to query V$LOCK or V$LOCKED_OBJECT. On my Web site I have a white paper titled "Solving User Problems," which shows how to query V$LOCK to see who has locked out other users.

There is no way to automatically notify user2 that user1 has locked the object. It is up to the DBA to decipher this information.

Dig Deeper on Oracle database design and architecture

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.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide.com

SearchDataCenter

SearchContentManagement

SearchHRSoftware

Close