Query the locked oracle table and the process of killing the locked table

Source: Internet
Author: User


Query the oracle-locked table and the process of killing the lock table. 1. First, check that the locked table contains too many processes: SELECT substr (v $ lock. sid, 1, 4) "SID", serial #, V $ SESSION. sid, substr (username,) "UserName", substr (object_name,) "ObjectName", v $ lock. type "LockType", www.2cto.com decode (rtrim (substr (lmode, 1, 4), '2', 'row-S (SS) ', '3 ', 'row-X (SX) ', '4', 'share', '5','s/Row-X (SSX) ', '6', 'exclusive ', 'other') "LockMode", substr (v $ session. program, 25, 1) "ProgramName"
From v $ LOCK, SYS. DBA_OBJECTS, V $ SESSIONWHERE (OBJECT_ID = v $ lock. id1 AND v $ lock. sid = v $ session. sid AND username is not null and username not in ('sys ', 'system') and serial #! = 1); 2. Process for killing the lock table: www.2cto.com alter system kill session 'sid, serial #';
 

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.