Home Database Mysql Tutorial 如何诊断cursorpinswaitonx系列一

如何诊断cursorpinswaitonx系列一

Jun 07, 2016 pm 04:12 PM
how series diagnosis first

首先明确一个事情:cursor pin s wait on x 是症状(结果),不是根本原因。 mutex related wait event cursor: pin S wait on X 一般原因: 》频繁硬解析(解析时间高. 找出解析时间高的原因很关键)----可能性最大 》high version counts 》bug 如何诊断?




首先明确一个事情:cursor pin s wait on x 是症状(结果),不是根本原因。
mutex related wait event "cursor: pin S wait on X"


一般原因:
》频繁硬解析(解析时间高. 找出解析时间高的原因很关键)----可能性最大
》high version counts
》bug


如何诊断?


1.AWR ADDM 报告


正常性能阶段的AWR ADDM 报告 (作为基线比对sql ,loadprofile 等)
非正常性能阶段的AWR ADDM 报告


SQL>@$ORACLE_HOME/rdbms/admin/awrrpt.sql
SQL>@$ORACLE_HOME/rdbms/admin/addmrpt.sql


2.system state dump


如果AWR 没有捕获到异常的sql ,使用 system state dump 可以捕获 holder ,waiter 进程
(a) Non-Rac
sqlplus "/ as sysdba"


oradebug setmypid
oradebug unlimit
oradebug dump systemstate 266
---wait 90 seconds---
oradebug dump systemstate 266
---wait 90 seconds---
oradebug dump systemstate 266
oradebug tracefile_name
quit


(b) RAC
$ sqlplus '/ as sysdba'
oradebug setmypid
oradebug unlimit
oradebug setinst all
oradebug -g all hanganalyze 4
oradebug -g all dump systemstate 267
oradebug tracefile_name
quit



3.errorstack
前提:已经确定 blocker 进程 ,使用 errorstack 可以捕获更多的信息


$ sqlplus
SQL> oradebug setospid
oradebug dump errorstack 3
>
oradebug dump errorstack 3
>
oradebug dump errorstack 3
exit




4.如何确定 blocker session?
使用 systemstate dump 对系统开销(disk space)太大,如果进程很多,则dump 会很大。
不是特别建议使用。可以采取方式:3
如何确定 blocker session?可以参考:
How to Determine the Blocking Session for Event: 'cursor: pin S wait on X' (文档 ID 786507.1)



根本原理:
The column P2RAW in v$session or v$session_wait gives the blocking session for wait event cursor: pin S wait on X.


10g:
--for 32bit
select p2raw,to_number(substr(to_char(rawtohex(p2raw)),1,4),'XXXX') sid
from v$session
where event = 'cursor: pin S wait on X';
P2RAW SID
---------------- ---
0000001F00000000 00


--for 64bit
select p2raw,to_number(substr(to_char(rawtohex(p2raw)),1,8),'XXXXXXXX') sid
from v$session
where event = 'cursor: pin S wait on X';


P2RAW SID
---------------- ---
0000001F00000000 31



-----根据上一步中的sid确定阻塞session:
SQL> select sid,serial#,SQL_ID,BLOCKING_SESSION,BLOCKING_SESSION_STATUS,EVENT
from v$session where SID=31;


-----11g 可以直接找到阻塞会话:
select sid,serial#,SQL_ID,BLOCKING_SESSION,BLOCKING_SESSION_STATUS,EVENT
from v$session where event ='cursor: pin S wait on X'


SID SERIAL# SQL_ID BLOCKING_SESSION BLOCKING_SESSION_STATUS EVENT
---- ------- ------------- ---------------- ----------------------- ----------
125 8190 lixora-lixora 135 VALID cursor: pin S wait on X



5.确定 waiter session
SELECT s.sid, t.sql_text
FROM v$session s, v$sql t
WHERE s.event LIKE '%cursor: pin S wait on X%'

AND t.sql_id = s.sql_id




Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Comprehensive Guide to PHP 500 Errors: Causes, Diagnosis and Fixes Comprehensive Guide to PHP 500 Errors: Causes, Diagnosis and Fixes Mar 22, 2024 pm 12:45 PM

A Comprehensive Guide to PHP 500 Errors: Causes, Diagnosis, and Fixes During PHP development, we often encounter errors with HTTP status code 500. This error is usually called "500InternalServerError", which means that some unknown errors occurred while processing the request on the server side. In this article, we will explore the common causes of PHP500 errors, how to diagnose them, and how to fix them, and provide specific code examples for reference. Common causes of 1.500 errors 1.

Xiaomi 15 series full codenames revealed: Dada, Haotian, Xuanyuan Xiaomi 15 series full codenames revealed: Dada, Haotian, Xuanyuan Aug 22, 2024 pm 06:47 PM

The Xiaomi Mi 15 series is expected to be officially released in October, and its full series codenames have been exposed in the foreign media MiCode code base. Among them, the flagship Xiaomi Mi 15 Ultra is codenamed "Xuanyuan" (meaning "Xuanyuan"). This name comes from the Yellow Emperor in Chinese mythology, which symbolizes nobility. Xiaomi 15 is codenamed "Dada", while Xiaomi 15Pro is named "Haotian" (meaning "Haotian"). The internal code name of Xiaomi Mi 15S Pro is "dijun", which alludes to Emperor Jun, the creator god of "The Classic of Mountains and Seas". Xiaomi 15Ultra series covers

The best time to buy Huawei Mate 60 series, new AI elimination + image upgrade, and enjoy autumn promotions The best time to buy Huawei Mate 60 series, new AI elimination + image upgrade, and enjoy autumn promotions Aug 29, 2024 pm 03:33 PM

Since the Huawei Mate60 series went on sale last year, I personally have been using the Mate60Pro as my main phone. In nearly a year, Huawei Mate60Pro has undergone multiple OTA upgrades, and the overall experience has been significantly improved, giving people a feeling of being constantly new. For example, recently, the Huawei Mate60 series has once again received a major upgrade in imaging capabilities. The first is the new AI elimination function, which can intelligently eliminate passers-by and debris and automatically fill in the blank areas; secondly, the color accuracy and telephoto clarity of the main camera have been significantly upgraded. Considering that it is the back-to-school season, Huawei Mate60 series has also launched an autumn promotion: you can enjoy a discount of up to 800 yuan when purchasing the phone, and the starting price is as low as 4,999 yuan. Commonly used and often new products with great value

Steps to fix 0x000000ed blue screen Steps to fix 0x000000ed blue screen Dec 25, 2023 am 09:15 AM

When many friends start the computer, a blue screen code 0X000000ED appears, and they cannot enter the system or operate it. What is going on? It may be that the hard disk is faulty, which prevents normal loading at startup. You can use the PE boot disk and enter safe mode to fix this problem. Let’s take a look at the specific tutorial below. How to deal with the 0x00000ed blue screen. Blue screen code: 0x000000ED blue screen. Cause: Hard drive failure. It may be that the hard drive is incompatible or has bad sectors, which results in the failure to load normally during startup. Explanation The I/0 subsystem failed while trying to load into the boot volume. Method 1: 1. First check if you can enter safe mode. If you can, open Run/enter CMD, type the command chkdsk/f/r and press Enter, then download

How to choose between iPhone 15 and iPhone 15 Pro? Nine major differences at once How to choose between iPhone 15 and iPhone 15 Pro? Nine major differences at once Sep 14, 2023 am 08:01 AM

iPhone15 and iPhone15Pro were officially released today. However, as high-end models, the Pro series not only has a higher price, but also has many exclusive features. Consumers must recognize the differences before buying, so as not to discover some problems after buying iPhone15. The function is only available in the Pro series. Although the monitors are equipped with the same display panel, the ProMotion automatic adaptive update frequency technology and the always-on display function are still exclusive to the Pro series. The rest of the iPhone 15 and iPhone 15 Pro series are the same in terms of resolution, contrast, peak brightness, etc. Action button The action button is currently an exclusive design for the iPhone 15 Pro series, allowing users to personalize it.

Is there a future for employment in clinical pharmacy at Harbin Medical University? (What are the employment prospects for clinical pharmacy at Harbin Medical University?) Is there a future for employment in clinical pharmacy at Harbin Medical University? (What are the employment prospects for clinical pharmacy at Harbin Medical University?) Jan 02, 2024 pm 08:54 PM

What are the employment prospects of clinical pharmacy at Harbin Medical University? Although the national employment situation is not optimistic, pharmaceutical graduates still have good employment prospects. Overall, the supply of pharmaceutical graduates is less than the demand. Pharmaceutical companies and pharmaceutical factories are the main channels for absorbing such graduates. The demand for talents in the pharmaceutical industry is also growing steadily. According to reports, in recent years, the supply-demand ratio for graduate students in majors such as pharmaceutical preparations and natural medicinal chemistry has even reached 1:10. Employment direction of clinical pharmacy major: After graduation, students majoring in clinical medicine can engage in medical treatment, prevention, medical research, etc. in medical and health units, medical research and other departments. Employment positions: Medical representative, pharmaceutical sales representative, sales representative, sales manager, regional sales manager, investment manager, product manager, product specialist, nurse

Common means to quickly diagnose and solve Go language website access speed problems Common means to quickly diagnose and solve Go language website access speed problems Aug 04, 2023 pm 01:12 PM

Common means of quickly diagnosing and solving Go language website access speed problems Summary: With the popularity of the Internet, website access speed is crucial to user experience. This article introduces common methods to quickly diagnose and solve Go language website access speed problems, and provides relevant code examples. Introduction: Go language is a high-performance programming language commonly used to build websites and services. However, websites built using Go language may encounter some problems in terms of access speed. This article will introduce some common methods to help developers quickly diagnose and resolve

Learn how to use memory diagnostics on Windows 11 Learn how to use memory diagnostics on Windows 11 Jan 05, 2024 pm 09:24 PM

Windows memory diagnosis can help us check whether the memory is healthy, but many users do not know how to use win11 memory diagnosis. In fact, they only need to open the system tools in the control panel. How to use memory diagnosis in win11 1. First, click the "Start Menu" or "Search" button at the bottom of the desktop. 2. In the search box above, click Search and open the "Control Panel" function. 3. Click to open the "System and Security" option in the Control Panel. 4. On this page, open the "Windows Tools" option at the bottom. 5. Double-click the option to run the "Windows Memory Diagnostic" tool. 6. Finally, click "Restart now and check for problems". (The system will automatically restart if there is a file

See all articles