[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的更多相关文章

  1. [20191126]探究等待事件的本源2.txt

    [20191126]探究等待事件的本源2.txt --//做一个测试,验证如果写入控制文件慢也会影响提交性能. 1.环境:SCOTT@book> @ ver1PORT_STRING        ...

  2. [20191125]探究等待事件的本源.txt

    [20191125]探究等待事件的本源.txt --//当工作中遇到oracle的性能问题时,查看awr报表提供很好的解决问题途径.但是有时候很容易想当然.--//比如以前我一看到 log file ...

  3. [20180316]理解db file parallel read等待事件.txt

    [20180316]理解db file parallel read等待事件.txt --//一直对db file parallel read等待事件不理解,因为在实际系统中很少遇到这样的等待事件. S ...

  4. 与IO相关的等待事件troubleshooting-系列9

    Buffer Cache与IO相关的等待事件: 这种等待事件的产生原因是包含DBWR进程和IO Slaves的Buffer Cache操作. 'db file parallel write' , 'd ...

  5. enq: TX - row lock contention“等待事件的处理

      enq: TX - row lock contention“等待事件的处理   session1: SQL> conn scott/triger Connected. SQL> CRE ...

  6. Oracle Tuning 基础概述01 - Oracle 常见等待事件

    对Oracle数据库整体性能的优化,首先要关注的是在有性能问题时数据库排名前几位等待事件是哪些.Oracle等待事件众多,随着版本的升级,数量还在不断增加,可以通过v$event_name查到当前数据 ...

  7. SQL SERVER中的OLEDB等待事件

    OLEDB等待事件介绍 OLEDB等待类型是SQL SERVER 数据库中最常见的几种等待类型之一.它意味着某个会话(SPID)通过SQL Server Native Client OLEDB Pro ...

  8. ORACLE等待事件:enq: TX - row lock contention

    enq: TX - row lock contention等待事件,这个是数据库里面一个比较常见的等待事件.enq是enqueue的缩写,它是一种保护共享资源的锁定机制,一个排队机制,先进先出(FIF ...

  9. ORACLE等待事件: log file parallel write

    log file parallel write概念介绍 log file parallel write 事件是LGWR进程专属的等待事件,发生在LGWR将日志缓冲区(log_buffer)中的重做日志 ...

随机推荐

  1. [TimLinux] systemd 精通CentOS7系统启动systemd

    1. 介绍 systemd: 在12种不同类型的实体单元(entity unit)间提供了一个依赖关系系统. 2. 几个概念 实体单元:为系统的启动和维护封装多种对象(object).主体单元在单元配 ...

  2. stm32 io操作 头文件规范

    在stm32众多项目开发中,有太多的对io进行操作,若置1或清0,使用官方库提供的函数,固然方便,规范,但是需要包含标准的库,尺寸较大,还得处理不同版本兼容问题,包括io初始化也太繁琐,于是操作原子等 ...

  3. java程序员面试经历(不忘初心,永不放弃,方得始终)。

    其实一直想静下心好好写一点博客,记录下青春,但一直忙于学习,写bug.....转眼间2017只剩下最后几天,岁月无情划过,不留痕迹,唯有稀疏地中海.哈哈,本篇文章主要是想分享下刚毕业入门找工作的一点小 ...

  4. 函数知识总结(js)

    c语言中函数的形参必须定义类型,而且形参的个数和实参的个数必须相等.但是在js中形参不需要定义,在函数定义的小括号中只需要写形参名就可以了不用写var关键字,而且在函数调用时传入的实参可以和形参的个数 ...

  5. vue组件初始化过程

    之前文章有写到vue构造函数的实例化过程,只是对vue实例做了个粗略的描述,并没有说明vue组件实例化的过程.本文主要对vue组件的实例化过程做一些简要的描述. 组件的实例化与vue构造函数的实例化, ...

  6. JS---DOM---为同一个元素绑定多个不同事件指向同一个事件处理函数

    为同一个元素绑定多个不同事件指向同一个事件处理函数 1. 用了switch(e.type){} 来修改 2. break <input type="button" value ...

  7. iOS Privacy Policy

    This application respects and protects the privacy of all users who use the service. In order to pro ...

  8. Please ensure the argon2 header and library are installed

    在CentOS上安装libargon2和libargon2-devel即可 yum install -y libargon2 libargon2-devel

  9. 数据卷(Data Volumes)

    Docker宿主机和容器之间文件拷贝docker copy 前言: Docker 数据管理 在生产环境中使用 Docker ,往往需要对数据进行持久化,或者需要在多个容器之间进行 数据共享,这必然涉及 ...

  10. FontLab VI for Mac 键盘快捷键

    使用FontLab VI for Mac,您可以创建,打开,修改,绘制,空间,文字,提示和导出桌面,网页,颜色和可变字体.该应用程序是一个全能的字体编辑器,但也支持与其他字体创建工具的数据交换,使其易 ...