Home > Database > Mysql Tutorial > body text

Oracle系统存在latch free等待事件及运行超长SQL监控分析

WBOY
Release: 2016-06-07 17:05:11
Original
1010 people have browsed it

Oracle系统存在latch free等待事件及运行超长SQL监控分析

1、latch free等待事件的SQL:

select *
from v$session_wait t
where t.EVENT not in
       ('SQL*Net message from client', 'rdbms ipc message',
        'SQL*Net more data from client', 'SQL*Net more data to client',
        'SQL*Net message to client', 'jobq slave wait')

结果分析说明:观察一下查询结果中有没有latch、enqueue的事件,要是有,就根据sid去找SQL的HASHVALUE

2、运行超长SQL监控SQL:

select * from v$session_longops a where a.time_remaining>0

结果分析说明:找到有全表扫描的,或者hash jion的,成本较高。需要找到hash_value,,再去v$sqltext查到具体的语句进行优化!

linux

source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!