Oracle table lock Handling Method

Source: Internet
Author: User


Oracle table lock processing method recently encountered such a problem, operate a table, found that the person is locked, so the query who locked the table, found that many people are locked, security, not all kill, use the following statement to determine who is locked and who is waiting. Www.2cto.com SELECT/* + rule */lpad ('', decode (l. xidusn, 0, 3, 0) | l. oracle_username User_name, o. owner, o. object_name, o. object_type, s. sid, s. serial # FROM v $ locked_object l, dba_objects o, v $ session s WHERE l. object_id = o. object_id AND l. session_id = s. sid order by o. object_id, xidusn DESC www.2cto.com // the query result is as follows, we may want to know who has locked the table and who is waiting for the above statement to query who has locked the table and who is waiting. The preceding query result is a tree structure. If a subnode exists, it indicates that a wait occurs. If you want to know which rollback segment is used for the lock, you can also associate it with V $ rollname. xidusn is the USN of the rollback segment to find out which records are locked and kill it. Alter system kill session '2017 6 ';

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.