Oracle finds the SQL statement that causes the wait according to v $ wait_chains

Source: Internet
Author: User
Oracle finds the SQL statement that causes the wait according to v $ wait_chains

Oracle finds the SQL statement that causes the wait according to v $ wait_chains

Functions of several views, from official documents
V $ sqltext
V $ SQLTEXTDisplays the text of SQL statements belonging to shared SQL cursors in the SGA.

V $ SESSION
V $ SESSIONDisplays session information for each current session.

V $ wait_chains
V $ WAIT_CHAINS
Displays information about blocked sessions. A wait chain is comprised of sessions that are blocked by one another. each row represents a blocked and blocker session pair. if a wait chain is not a valid ical wait chain, then the last row for the chain does not have a blocker.

Locate the SQL statement that causes the wait

  • Select * from v $ sqltext
  • Where
  • (Hash_value, address) in
  • (
  • Select decode (SQL _hash_value, 0, prev_hash_value, SQL _hash_value ),
  • DECODE (SQL _hash_value, 0, prev_ SQL _addr, SQL _address)
  • FROM v $ session
  • Where sid in (select sid from v $ wait_chains)
  • );
  • ,

    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.