How to delete the deadlock process in Oracle, and delete the lock process in oracle

Source: Internet
Author: User
Tags vps

How to delete the deadlock process in Oracle, and delete the lock process in oracle

This example describes how to delete a deadlock process in Oracle. Share it with you for your reference. The details are as follows:

Step 1: Use the following SQL statement to view the process list and identify the locked table
Copy codeThe Code is as follows: SELECT dob. OBJECT_NAME Table_Name, lo. SESSION_ID | ',' | vss. SERIAL # delete number,
Lo. locked_mode, lo. SESSION_ID, vss. SERIAL #, vss. action Action, vss. osuser OSUSER, vss. LOGON_TIME,
Vss. process AP_PID, VPS. SPID DB_PID, vss .*
From v $ locked_object lo, dba_objects dob, v $ session vss, V $ PROCESS VPS
Where lo. OBJECT_ID = dob. OBJECT_ID
And lo. SESSION_ID = vss. SID
And vss. paddr = VPS. addr
Order by 2, 3, DOB. object_name

Searching locked tables

Step 2: delete a process. If the result of the previous "delete number" is "286,218 4", run the following SQL
Copy codeThe Code is as follows: ALTER system kill session '2017 4'

It will not take effect immediately after deletion. It will take a while.

I hope this article will help you with Oracle programming.

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.