Oracle table deadlock handling ORA-00054

Source: Internet
Author: User
Try to delete sqlplus using SQL commands. If the deletion is successful, everything is fine! However, when a deadlock occurs

Try to delete sqlplus using SQL commands. If the deletion is successful, everything is fine! However, when a deadlock occurs

Step 1: Try to delete sqlplus using the SQL command. If the deletion is successful, everything is fine! However, if you want to delete a session with a deadlock through a command line or using an Oracle management tool, oracle will only mark the session as killed but cannot clear it, you often need to delete it at the operating system level through step 2!

Connected to Oracle9i Enterprise Edition Release 9.2.0.1.0
Connected as quik

SQL> select xidusn, object_id, session_id, locked_mode from v $ locked_object; -- query the deadlock object and obtain its SESSION_ID

XIDUSN OBJECT_ID SESSION_ID LOCKED_MODE
-----------------------------------------
10 30724 29 3
10 30649 29 3

SQL> select username, sid, serial # from v $ session where sid = 29; -- view its serial # number based on the sid obtained in the previous step.

Username sid serial #
--------------------------------------------------
QUIK 29 57107

SQL> alter system kill session '29,571 07 '; -- delete a process. If the process has been deleted, a ora-00031 error is reported; otherwise, oracle marks the session as killed, wait for a while to see if it will automatically disappear. If it cannot disappear for a long time, follow-up steps are required.

Alter system kill session '2017 07'

ORA-00031: session marked for kill

SQL> select pro. spid from v $ session ses, v $ process pro where ses. sid = 29 and ses. paddr = pro. addr; -- view the spid to delete a process according to the ID in the operating system.

SPID
------------
2273286

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.