[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)中的重做日志 ...
随机推荐
- 带你从头到尾捋一遍MySQL索引结构(2)
前言 Hello我又来了,快年底了,作为一个有抱负的码农,我想给自己攒一个年终总结.索性这次把数据库中最核心的也是最难搞懂的内容,也就是索引,分享给大家. 这篇博客我会谈谈对于索引结构我自己的看法,以 ...
- golang包管理的古往今来
https://golang.org/ before GO1.5-GOPATH 在GO1.5之前用GOPATH以及GOROOT这两个环境变量来决定包的位置. GOROOT就是告知当前go的安装位置,编 ...
- Python中的input你真会吗?
前言本文的文字及图片来源于网络,仅供学习.交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理.作者:一米阳光里的晴天娃娃 python中的input()方法是在控制台可 ...
- Docker--DockerFile创建自己的image
echo编辑整理,欢迎转载,转载请声明文章来源.欢迎添加echo微信(微信号:t2421499075)交流学习. 百战不败,依不自称常胜,百败不颓,依能奋力前行.--这才是真正的堪称强大!!! 在我们 ...
- JS-引用类型的参数传递
- Java 判断密码是否是大小写字母、数字、特殊字符中的至少三种
public class CheckPassword { //数字 public static final String REG_NUMBER = ".*\\d+.*"; //小写 ...
- 《Java基础知识》Java static关键字以及Java静态变量和静态方法
static 修饰符能够与变量.方法一起使用,表示是“静态”的. 静态变量和静态方法能够通过类名来访问,不需要创建一个类的对象来访问该类的静态成员,所以static修饰的成员又称作类变量和类方法.静态 ...
- JS中原始值和引用值分析
JS中变量中两种类型的值:原始值,引用值 原始值是存储在栈(stack)中的简单数据段,也就是说,它们的值直接存储在变量访问的位置. var x = 1; //1就是一个原始值,变量x中存放的就是原始 ...
- Caffe源码-Net类(下)
net.cpp部分源码 // 接着上一篇博客的介绍,此部分为Net类中前向反向计算函数,以及一些与HDF5文件或proto文件相互转换的函数. template <typename Dtype& ...
- elementui移动dialog
1.在创建Vue对象时添加全局属性 Vue.directive('dialogDrag', { bind(el, binding, vnode, oldVnode) { const dialogHea ...