How to unlock records in Oracle

Source: Internet
Author: User

Today, when update is used to update a record, it cannot be updated and remains unresponsive. When the row record is edited and submitted, the record is locked, to find out the specific cause.

Finally, the record is updated through the following methods:

1. view database locks and diagnose the source and type of locks

 
  1 Select Object_id, Session_id, locked_modeFromV $ locked_object;

 

Or:

  1 SelectB. Owner, B.Object_name, L. session_id, L. locked_mode
2  FromV $ locked_object L, dba_objects B
3  WhereB.Object_id=L.Object_id

 

2. Find the database's serial # value to kill

 
  1 SelectT2.username, t2.sid, t2.serial #, t2.logon _ time
2  FromV $ locked_object T1, V $ session T2
3  WhereT1.session _ id=T2.sidOrder ByT2.logon _ time;

 

3. Killing the locked session

 
  1 AlterSystemKillSession'Sid, serial #' 

 

You can also restart the database.

Do you have any other good methods? Are you welcome to join us and learn from each other ~~~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.