[20191127]探究等待事件的本源4.txt
[20191127]探究等待事件的本源4.txt
--//昨天使用ash_wait_chains.sql脚本把各个生产库执行1遍,才发现我对一套系统性能理解错误.
--//我一直以为这套系统存储有点问题,性能不是很好.
1.环境:
xxxxxx> @ ver1
PORT_STRING VERSION BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx 11.2.0.4.0 Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
2.分析:
xxxxxx> @ tpt/ash/ash_wait_chains event2 1=1 trunc(sysdate)+8/24 sysdate
-- Display ASH Wait Chain Signatures script v0.2 BETA by Tanel Poder ( http://blog.tanelpoder.com )
%This SECONDS AAS WAIT_CHAIN
------ ---------- ---------- -------------------------------------------------------------
39% 2667 .5 -> ON CPU
18% 1274 .2 -> LNS wait on SENDREQ
18% 1249 .2 -> log file sync -> LGWR-LNS wait on channel
18% 1215 .2 -> LGWR-LNS wait on channel
1% 62 0 -> log file sync
1% 60 0 -> log file parallel write
1% 46 0 -> control file sequential read
1% 39 0 -> db file sequential read
1% 36 0 -> log file sync -> log file parallel write
0% 29 0 -> gc cr block 2-way
0% 24 0 -> gc current block 2-way
0% 23 0 -> null event
0% 21 0 -> direct path read
0% 20 0 -> log file sync -> ON CPU
0% 18 0 -> gcs log flush sync -> LGWR-LNS wait on channel
0% 18 0 -> gc cr block busy
0% 16 0 -> db file parallel write
0% 12 0 -> SQL*Net more data to client
0% 10 0 -> gc cr multi block request
0% 9 0 -> gc current grant busy
0% 7 0 -> Disk file operations I/O
0% 6 0 -> ASM file metadata operation
0% 5 0 -> log file sequential read
0% 4 0 -> LGWR wait on LNS
0% 4 0 -> log file switch completion -> LGWR-LNS wait on channel
0% 4 0 -> IPC send completion sync
0% 4 0 -> control file parallel write
0% 3 0 -> reliable message
0% 3 0 -> log file sync -> LGWR wait on LNS
0% 2 0 -> CGS wait for IPC msg
30 rows selected.
xxxxxx> select sysdate from dual ;
SYSDATE
-------------------
2019-11-27 09:27:51
xxxxxx> @ tpt/ash/ash_wait_chains event2 "event='log file sync'" trunc(sysdate)+8/24 sysdate
-- Display ASH Wait Chain Signatures script v0.2 BETA by Tanel Poder ( http://blog.tanelpoder.com )
%This SECONDS AAS WAIT_CHAIN
------ ---------- ---------- ----------------------------------------------
91% 1249 .2 -> log file sync -> LGWR-LNS wait on channel
5% 62 0 -> log file sync
3% 36 0 -> log file sync -> log file parallel write
1% 20 0 -> log file sync -> ON CPU
0% 3 0 -> log file sync -> LGWR wait on LNS
--//实际上主要问题在于log_archive_dest_2参数设置不合理,采用sync参数.
xxxxxx> show parameter log_archive_dest_2
NAME TYPE VALUE
------------------ ------ ----------------------------------------------------------------------------------------------------
log_archive_dest_2 string service=xxxxxx lgwr sync reopen=15 max_failure=10 net_timeout=30 optional noaffirm db_unique_name=xxxxx
xxxxxx> show parameter log_archive_config
NAME TYPE VALUE
------------------ ------ -----------
log_archive_config string nodg_config
--//实际上我第一次看应该是去年的春节前后,刚上线,当时这个问题没有严重,现在显得越来越明显.
--//"可怕"的是我不能修改这个参数,这个所谓的dg是一个第三方安装的东西,根本不是什么dg,我一修改参数,对方的软件视乎就检测我的改动,自动重置回来.
--//alter system set log_archive_dest_2="service=xxxxxx lgwr async reopen=15 max_failure=10 net_timeout=30 optional noaffirm db_unique_name=xxxxxx";
--//btw:好像这个参数可以修改,也许我记错了,不能修改log_archive_config参数,等一段时间观察看看.
--//看awr报表:
Top 10 Foreground Events by Total Wait Time
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tota Wait % DB
Event Waits Time Avg(ms) time Wait Class
------------------------------ ------------ ---- ------- ------ ----------
DB CPU 1063 78.5
log file sync 46,848 311. 7 23.0 Commit
control file sequential read 68,350 21.1 0 1.6 System I/O
gc cr block 2-way 17,827 8.2 0 .6 Cluster
gc current block 2-way 17,190 7.4 0 .5 Cluster
gc cr block busy 218 6.8 31 .5 Cluster
SQL*Net more data to client 541,828 6.4 0 .5 Network
db file sequential read 936 6 6 .4 User I/O
direct path read 1,591 5.2 3 .4 User I/O
Disk file operations I/O 23,740 4.6 0 .3 User I/O
--//log file sync 平均等待7ms,到业务高峰可以到达13-14ms.我开始以为磁盘io不行,或者使用asm的原因.实际是就是上面的参数设置不合理.
--//如果不小心选择优化磁盘IO,那就选择错误的优化方向.实际上这套系统cpu充足,磁盘性能也不差,典型的大马拉小车.
--//主要问题在于应用软件垃圾(不仅仅指这个dg设置)!!也就是我以前提得良好的硬件掩盖拙劣的应用设计.
--//再来看看control file sequential read等待事件:
IOStat by Filetype summary DB/Inst: zzzzz/zzzzz1 Snaps: 25477-25478
-> 'Data' columns suffixed with M,G,T,P are in multiples of 1024
other columns suffixed with K,M,G,T,P are in multiples of 1000
-> Small Read and Large Read are average service times, in milliseconds
-> Ordered by (Data Read + Write) desc
Reads: Reqs Data Writes: Reqs Data Small Large
Filetype Name Data per sec per sec Data per sec per sec Read Read
--------------- ------- ------- ------- ------- ------- ------- ------- -------
Control File 8.3G 27.2 2.382M 228M 3.6 .064M 0.1 0.8
Log File 206M 0.1 .058M 228M 20.4 .064M 1.5 6.0
Data File 64M 2.2 .018M 235M 4.6 .066M 2.3 N/A
Archive Log 1M 0.2 0M 205M 0.1 .057M 0.0 N/A
Temp File 23M 0.0 .006M 23M 0.0 .006M 0.0 1.7
TOTAL: 8.6G 29.7 2.464M 919M 28.6 .257M 0.3 0.9
------------------------------------------------------
--//实际上对方的软件简直是变态,关于这个问题的描述在链接如下,不再分析展开贴出:
--//http://blog.itpub.net/267265/viewspace-2222146/=>[20181129]大量的control file sequential read.txt.
3.修改参数后的观察:
--//检查alert发现,是Wed Nov 27 09:33:31 2019修改参数
Wed Nov 27 09:33:31 2019
ALTER SYSTEM SET log_archive_dest_2='service=xxxxx lgwr async reopen=15 max_failure=10 net_timeout=30 optional noaffirm db_unique_name=xxxxx' SCOPE=BOTH;
xxxxxx> select sysdate from dual ;
SYSDATE
-------------------
2019-11-27 10:08:20
xxxxxx> @ tpt/ash/ash_wait_chains event2 "event='log file sync'" trunc(sysdate)+9/24+33/1440 sysdate
-- Display ASH Wait Chain Signatures script v0.2 BETA by Tanel Poder ( http://blog.tanelpoder.com )
%This SECONDS AAS WAIT_CHAIN
------ ---------- ---------- -----------------------------------------------------------------------------------------------
57% 26 0 -> log file sync -> LGWR-LNS wait on channel
33% 15 0 -> log file sync
9% 4 0 -> log file sync -> log file parallel write
2% 1 0 -> log file sync -> ON CPU
xxxxxx> @ tpt/ash/ash_wait_chains event2 "event='log file sync'" trunc(sysdate)+9/24+34/1440 sysdate
-- Display ASH Wait Chain Signatures script v0.2 BETA by Tanel Poder ( http://blog.tanelpoder.com )
%This SECONDS AAS WAIT_CHAIN
------ ---------- ---------- -----------------------------------------------------------------------------------------------
74% 14 0 -> log file sync
21% 4 0 -> log file sync -> log file parallel write
5% 1 0 -> log file sync -> ON CPU
--//你可以对比看出取值范围9:33换成9:34,多了1分钟由LGWR-LNS wait on channel引起的log file sync占26秒,而9:34后的查询完全看不到这个情况.
xxxxxx> @ tpt/ash/ash_wait_chains program2||event2 1=1 trunc(sysdate)+9/24+34/1440 sysdate
-- Display ASH Wait Chain Signatures script v0.2 BETA by Tanel Poder ( http://blog.tanelpoder.com )
%This SECONDS AAS WAIT_CHAIN
------ ---------- ---------- -----------------------------------------------------------------------------------------------
36% 547 .2 -> (zzzzzz.EXE) ON CPU
13% 204 .1 -> (wnwp.exe) ON CPU
9% 145 .1 -> (zzzzzz.EXE) ON CPU
7% 107 0 -> (NSAn) ON CPU
5% 80 0 -> (CAPAA-PIPE) ON CPU
3% 40 0 -> (httpd.exe) ON CPU
2% 31 0 -> (sqlplus) ON CPU
2% 31 0 -> (DIAn) ON CPU
2% 24 0 -> (oracle) ON CPU
1% 22 0 -> (LGWR) ON CPU
1% 22 0 -> (PSPn) ON CPU
1% 21 0 -> (LGWR) log file parallel write
1% 16 0 -> (NSAn) LNS wait on SENDREQ
1% 15 0 -> (sqlplus) control file sequential read
1% 15 0 -> (LMSn) ON CPU
1% 13 0 -> (zzzzzz.EXE) db file sequential read
1% 12 0 -> (zzzzzz.EXE) gc cr block 2-way
1% 12 0 -> (routine.exe) ON CPU
1% 12 0 -> (PlSqlDev.exe) ON CPU
1% 10 0 -> (Toad.exe) ON CPU
1% 10 0 -> (DBWn) db file parallel write
0% 7 0 -> (DBWn) ON CPU
0% 7 0 -> (wnwp.exe) log file sync
0% 6 0 -> (zzzzzz.EXE) gc current block 2-way
0% 6 0 -> (zzzzzz.EXE) log file sync
0% 6 0 -> (zzzzzz.EXE) direct path read
0% 5 0 -> (zzzzzz.EXE) log file sync
0% 5 0 -> (LMON) ON CPU
0% 4 0 -> (wnwp.exe) log file sync -> (LGWR) log file parallel write
0% 4 0 -> (MMON) ON CPU
30 rows selected.

[20191127]探究等待事件的本源4.txt的更多相关文章
- [20191126]探究等待事件的本源2.txt
[20191126]探究等待事件的本源2.txt --//做一个测试,验证如果写入控制文件慢也会影响提交性能. 1.环境:SCOTT@book> @ ver1PORT_STRING ...
- [20191125]探究等待事件的本源.txt
[20191125]探究等待事件的本源.txt --//当工作中遇到oracle的性能问题时,查看awr报表提供很好的解决问题途径.但是有时候很容易想当然.--//比如以前我一看到 log file ...
- [20180316]理解db file parallel read等待事件.txt
[20180316]理解db file parallel read等待事件.txt --//一直对db file parallel read等待事件不理解,因为在实际系统中很少遇到这样的等待事件. S ...
- 与IO相关的等待事件troubleshooting-系列9
Buffer Cache与IO相关的等待事件: 这种等待事件的产生原因是包含DBWR进程和IO Slaves的Buffer Cache操作. 'db file parallel write' , 'd ...
- enq: TX - row lock contention“等待事件的处理
enq: TX - row lock contention“等待事件的处理 session1: SQL> conn scott/triger Connected. SQL> CRE ...
- Oracle Tuning 基础概述01 - Oracle 常见等待事件
对Oracle数据库整体性能的优化,首先要关注的是在有性能问题时数据库排名前几位等待事件是哪些.Oracle等待事件众多,随着版本的升级,数量还在不断增加,可以通过v$event_name查到当前数据 ...
- SQL SERVER中的OLEDB等待事件
OLEDB等待事件介绍 OLEDB等待类型是SQL SERVER 数据库中最常见的几种等待类型之一.它意味着某个会话(SPID)通过SQL Server Native Client OLEDB Pro ...
- ORACLE等待事件:enq: TX - row lock contention
enq: TX - row lock contention等待事件,这个是数据库里面一个比较常见的等待事件.enq是enqueue的缩写,它是一种保护共享资源的锁定机制,一个排队机制,先进先出(FIF ...
- ORACLE等待事件: log file parallel write
log file parallel write概念介绍 log file parallel write 事件是LGWR进程专属的等待事件,发生在LGWR将日志缓冲区(log_buffer)中的重做日志 ...
随机推荐
- 统计学习方法与Python实现(二)——k近邻法
统计学习方法与Python实现(二)——k近邻法 iwehdio的博客园:https://www.cnblogs.com/iwehdio/ 1.定义 k近邻法假设给定一个训练数据集,其中的实例类别已定 ...
- 测底稳定NIOS开发之一:将nios产生的编程文件转换成jic (连载)
将nios产生的编程文件转换成jic 前言: 基于某种原因,自从开始fpga开发和nios项目开发中,均为正常使用EDS IDE自带的flash programmer 进行成功的下载固化epcs程序. ...
- 双重检查锁单例模式为什么要用volatile关键字?
前言 从Java内存模型出发,结合并发编程中的原子性.可见性.有序性三个角度分析volatile所起的作用,并从汇编角度大致说了volatile的原理,说明了该关键字的应用场景:在这补充一点,分析下v ...
- Spring Cloud第九篇 | 分布式服务跟踪Sleuth
本文是Spring Cloud专栏的第九篇文章,了解前八篇文章内容有助于更好的理解本文: Spring Cloud第一篇 | Spring Cloud前言及其常用组件介绍概览 Spring Cl ...
- 格式化字符串漏洞 format string exploit(一)
本文系原创,转载请说明出处 本文为基于CTF WIKI的PWN学习 0x00 格式化字符串原理 先附一张经典的图,如下 其栈上布局如下: some value 3.14 123456 addr of ...
- Cesium案例解析(二)——ImageryLayers影像图层
目录 1. 概述 2. 实例 2.1. ImageryLayers.html 2.2. ImageryLayers.js 2.2.1. 代码 2.2.2. 解析 3. 结果 1. 概述 Cesium支 ...
- Oracle Proc编程性能优化经验
Proc 是Oracle提供的一种数据库操作的API.它是基于ESql技术的,需要预编译后才可以变成普通c代码,非常不直观,使用起来不太方便,阅读也存在困难. 因为这些问题导致程序员平时开发中会出现一 ...
- NPOI 设置下拉列表
HSSFWorkbook workbook = new HSSFWorkbook();//创建工作簿 ISheet sheet = workbook.CreateSheet();//创建sheet页 ...
- Android 仿真器 无法启动排查
从命令行启动仿真器,可以查看其输出. Microsoft Windows [版本 10.0.18362.145] (c) 2019 Microsoft Corporation.保留所有权利. C:\U ...
- C++之下载Visual Studio Installer缓慢问题
将IPv4中设置DNS首选项为8.8.8.8即可.