Oracle table lock, kill lock table process

Source: Internet
Author: User

Background

  • When operating Oracle, when multiple people operate the same table in the Oracle database at the same time, it often results in a lock table phenomenon that needs to be unlocked manually.

Steps

  • Log in to the Oracle database as DBA (otherwise users are missing the kill process privilege and need to assign permissions to the user)
    • Sqlplus/as SYSDBA, such as
  • To view locked table processes
    • Select B.owner,b.object_name,a.session_id,a.locked_mode from V$locked_object a,dba_objects b where b.object_id = a.object_id;
  • Find the SID and serial# of the lock table process because SIDS and serial# collectively determine the unique database process session
    • Select B.username,b.sid,b.serial#,logon_time from V$locked_object a,v$session b where a.session_id = B.sid ORDER by B.logo N_time;
  • Kill the process
    • Alter system kill session ' sid,serial# ';

Oracle table lock, kill lock table process

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.