How to diagnose the reason for a wait event in a past time period

Source: Internet
Author: User

1. View a blocking session for a waiting event
Select Event,blocking_session,sql_id,count (*) from Dba_hist_active_sess_history Ash
where Sample_time>=to_timestamp (' 2013-06-24 12:25:00 ', ' yyyy-mm-dd hh24:mi:ss ')
and Sample_time<=to_timestamp (' 2013-06-24 12:35:00 ', ' yyyy-mm-dd hh24:mi:ss ')
and event= ' Cursor:pin S wait on X '
GROUP BY event,blocking_session,sql_id/

To view an SQL statement waiting for an event
Sql> Select Sql_text from V$sql where sql_id= ' 8duehra3kdx62 ';

2. View the blocking session that caused the session waiting above
Sql> Select Event,blocking_session,sql_id,count (*) from Dba_hist_active_sess_history Ash
where Sample_time>=to_timestamp (' 2013-06-24 12:25:00 ', ' yyyy-mm-dd hh24:mi:ss ')
and Sample_time<=to_timestamp (' 2013-06-24 12:35:00 ', ' yyyy-mm-dd hh24:mi:ss ')
and ash.session_id=2
GROUP BY event,blocking_session,sql_id

See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/storage/

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.