Oracle Commands for Locks

Source: Internet
Author: User

--Query row lock statement

Select Sql_text from V$sql a,v$session bwhere a.sql_id=b.sql_id and b.event= ' enq:tx-row lock contention ';

--Find the table that is locked

SELECT object_name, Machine, S.sid, S.serial#from gv$locked_object l, dba_objects o, gv$session swhere l.object_id = o.obj Ect_idand l.session_id = S.sid;

--Unlock

Select     s.sid,s.machine,o.object_name,l.oracle_username,l.locked_mode,       ' ALTER     SYSTEM     KILL     ' SESSION "     | | s.sid| | ', ' | | s.serial#| | '; ' Command       from     v$locked_object     l,v$session     s,all_objects     o       where     l.session_id= S.sid     and     l.object_id=o.object_id;  

Oracle Commands for Locks

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.