The script used to check the row lock wait problem (both standalone and rac are common) and the script rac

Source: Internet
Author: User

The script used to check the row lock wait problem (both standalone and rac are common) and the script rac

Source:

How to use historic ASH data to identify lock conflicts (Doc ID 1593227.1)

For the current lock, the script is (applicable to standalone and rac ):

with lk as (select blocking_instance||'.'||blocking_session blocker, inst_id||'.'||sid waiter             from gv$session             where blocking_instance is not null               and blocking_session is not null)select lpad('  ',2*(level-1))||waiter lock_tree from (select * from lk  union all  select distinct 'root', blocker from lk  where blocker not in (select waiter from lk))connect by prior waiter=blocker start with blocker='root';
Note: The preceding statements cannot be executed in the SQL windows window of plsql-dev. They can be executed in the command windows window of plsql-dev and in sqlplus. The query result is:

That is to say, the sssion with sid 1094 of instance 1 blocks the session with sid 1077 of instance 1.

This is the situation where one session blocks one session. Next we will look at the situation where one session blocks two sessions:



That is to say, the sssion with sid 1094 of instance 1 blocks two sessions: for example 1 with a session whose sid is 1077 and a session whose sid is 1086 on instance 1, use the script of Hou shengwen (Thank you for your attention). The result is as follows:




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.