Oracle Database update is stuck

Source: Internet
Author: User

I made a small modification to the eclipse project today and found that the previously running project is always stuck today. I started to think that the database has not closed the connection, leading to connection congestion, later, I took a closer look at every closed link. The next breakpoint debugging finds that a problem occurs during the update process and the program is stuck on the update process. I use plsql to query data in the database, which is also stuck, and another piece of data can be normally executed. Google finds the cause of the problem.

Oracle automatically locks the record when the program has executed executeupdate but has not committed the transaction commit.

The solution is as follows.

Query the sid and serial # Fields of the locked data.

  1. SELECT s. sid,
  2. S. serial #
  3. FROM v $ locked_object lo,
  4. Dba_objects ao,
  5. V $ session s
  6. WHERE ao. object_id = lo. object_id AND lo. session_id = s. sid;

Delete the record locked by the system.

ALTER system KILL session'Sid, serial #';

If there are multiple sid and serial #, delete each record repeatedly.

Related Article

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.