Recently, our application system has updated one app. I receive a email of complain the db server changing slowly, after some days.

I see the war reports and find one top event which is the reason why the db sever changing slowly.

Event Waits Time(s) Avg wait (ms) % DB time Wait Class
log file sync 623,700 15,985 26 84.99 Commit
DB CPU   2,124   11.29  
db file scattered read 226,702 549 2 2.92 User I/O
db file sequential read 137,232 251 2 1.34 User I/O
SQL*Net more data from client 606,953 103 0 0.55 Network

log file sync:

The Oracle "log file sync" wait event is triggered when a user session issues a commit (or a rollback). The user session will signal or post the LGWR to write the log buffer to the redo log file. When the LGWR has finished writing, it will post the user session. The wait is entirely dependent on LGWR to write out the necessary redo blocks and send confirmation of its completion back to the user session. The wait time includes the writing of the log buffer and the post, and is sometimes called "commit latency".

Reducing oracle waits

If a SQL statement is encountering a significant amount of total time for this event, the average wait time should be examined. If the average wait time is low, but the number of waits is high, then the application might be committing after every row, rather than batching COMMITs. Oracle applications can reduce this wait by committing after "n" rows so there are fewer distinct COMMIT operations. Each commit has to be confirmed to make sure the relevant REDO is on disk. Although commits can be "piggybacked" by Oracle, reducing the overall number of commits by batching transactions can be very beneficial.

If the SQL statement is a SELECT statement, review the Oracle Auditing settings. If Auditing is enabled for SELECT statements, Oracle could be spending time writing and commit data to the AUDIT$ table.

If the average wait time is high, then examine the other log related waits for the session, to see where the session is spending most of its time. If a session continues to wait on the same buffer# then the SEQ# column of V$SESSION_WAIT should increment every second. If not then the local session has a problem with wait event timeouts. If the SEQ# column is incrementing then the blocking process is the LGWR process. Check to see what LGWR is waiting on as it may be stuck.

If the waits are because of slow I/O, then try the following:

  • Reduce other I/O activity on the disks containing the redo logs, or use dedicated disks.

    • Try to reduce resource contention. Check the number of transactions (commits + rollbacks) each second, from V$SYSSTAT.
  • Alternate redo logs on different disks to minimize the effect of the archiver on the log writer.
  • Move the redo logs to faster disks or a faster I/O subsystem (for example, switch from RAID 5 to RAID 1).
  • Consider using raw devices (or simulated raw devices provided by disk vendors) to speed up the writes.
  • See if any activity can safely be done with NOLOGGING / UNRECOVERABLE options in order to reduce the amount of redo being written.
  • See if any of the processing can use the COMMIT NOWAIT option (be sure to understand the semantics of this before using it).
  • Check the size of the log buffer as it may be so large that LGWR is writing too many blocks at one time.
Elapsed Time (s) Executions Elapsed Time per Exec (s) %Total %CPU %IO SQL Id SQL Module SQL Text
                 
68.17 140,990 0.00 0.36 97.31 0.00 7m9wpnw8jg207   update ts_receipt_bill_biz set...
64.30 131,830 0.00 0.34 99.30 0.07 b17sff2vp0rt6   update ts_receipt_bill set dis...

THERE ARE LOTS OF UPDATING OPERATION IN THIS DB VIA AWR REPORT. AND THE PROGRAMER TELL ME THAT THERE IS A BATH PACKAGE FOR THE APPLICATION WHICH WILL BE UPDATING MORE THAN 10000 ROWS AND WITH COMMIT EVERY 30 ROWS. SO MODIFY THE PROGRAM CAN SOLVE THE TOP EVENT.


log file sync的更多相关文章

  1. log file sync等待超高一例

    这是3月份某客户的情况,原因是server硬件故障后进行更换之后,业务翻译偶尔出现提交缓慢的情况.我们先来看下awr的情况. 我们能够看到,该系统的load profile信息事实上并不高,每秒才21 ...

  2. 理解LGWR,Log File Sync Waits以及Commit的性能问题[转]

    理解LGWR,Log File Sync Waits以及Commit的性能问题 一.概要: 1.  Commit和log filesync的工作机制 2.  为什么log file wait太久 3. ...

  3. log file sync 等侍值高的一般通用解决办法

    log file sync等待时间发生在redo log从log buffer写入到log file期间. 下面对log file sync做个详细的解释. 何时发生日志写入: 1.commit或者r ...

  4. log file sync 因为数据线有问题而造成高等侍的表现

    这是3月份某客户的情况,原因是服务器硬件故障后进行更换之后,业务翻译偶尔出现提交缓慢的情况.我们先来看下awr的情况. 我们可以看到,该系统的load profile信息其实并不高,每秒才21个tra ...

  5. 完全揭秘log file sync等待事件-转自itpub

    原贴地址:http://www.itpub.net/thread-1777234-1-1.html   谢谢 guoyJoe 老大 这里先引用一下tanel poder大师的图: 什么是log fil ...

  6. Script to Collect Log File Sync Diagnostic Information (lfsdiag.sql) (文档 ID 1064487.1)

    the article from :http://m.blog.itpub.net/31393455/viewspace-2130875/ Script to Collect Log File Syn ...

  7. log file sync 事件(转)

    log file sync   log file sync等待时间发生在redo log从log buffer写入到log file期间. 下面对log file sync做个详细的解释.   何时发 ...

  8. RAC 性能分析 - 'log file sync' 等待事件

    简介 本文主要讨论 RAC 数据库中的'log file sync' 等待事件.RAC 数据库中的'log file sync' 等待事件要比单机数据库中的'log file sync' 等待事件复杂 ...

  9. oracle之 等待事件LOG FILE SYNC (awr)优化

    log file sycn是ORACLE里最普遍的等待事件之一,一般log file sycn的等待时间都非常短 1-5ms,不会有什么问题,但是一旦出问题,往往都比较难解决.什么时候会产生log f ...

随机推荐

  1. Review PHP设计模式之——单例模式

    单例模式: class Single { private static $_instance; private function __construct(){ //define method as p ...

  2. C++ list 类学习笔记

    双向循环链表list list是双向循环链表,,每一个元素都知道前面一个元素和后面一个元素.在STL中,list和vector一样,是两个常被使用的容器.和vector不一样的是,list不支持对元素 ...

  3. javascript insertBefore 和 appendChild

    js的appendChild()方法 :在一个元素内部追加一个子节点. js的insertBefore()方法:在一个元素内部指定的子节点之前插入子节点. 很明显,appendChild()方法只需要 ...

  4. MySQL的alter的使用

    ALTER TABLE 语句用于在已有的表中添加.修改或删除列 1.ADD [COLUMN] column name (column definitions) [FIRST or AFTER colu ...

  5. POJ 3701 概率DP

    给定2^n 支足球队进行比赛,n<=7. 队伍两两之间有一个获胜的概率,求每一个队伍赢得最后比赛的概率是多少? 状态其实都是很显然的,一开始觉得这个问题很难啊,不会.dp[i][j] 表示第i支 ...

  6. Xcode免证书打包ipa

    1,创建证书 打开“钥匙串访问”创建证书 填写好内容后点击继续,之后的步骤什么都不用改,一路点击“确定”和“继续”,最后完成这个向导就可以了. 我们创建的证书是不被信任的,右键点击证书选择“显示简介” ...

  7. 1045: [HAOI2008] 糖果传递 - BZOJ

    Description 有n个小朋友坐成一圈,每人有ai个糖果.每人只能给左右两人传递糖果.每人每次传递一个糖果代价为1.Input 小朋友个数n 下面n行 aiOutput 求使所有人获得均等糖果的 ...

  8. pl/sql developer连接远程数据库

    本地不安装oracle client程序,直接使用pl/sql developer连接远程数据库 考虑到机子本身资源有限,一个client会占用很多资源,尝试使用不安装客户端的方式进行远程连接. 需要 ...

  9. uva 11461

    简单 打个表 case数不超过200 数据比较水  木有超时的风险~~ /*************************************************************** ...

  10. XP纯净版光盘ISO镜像文件

    原版xp的下载地址,直接发链接得了-.-打开迅雷,按新建任务,把下面下载地址复制进来,下载就可以了 thunder://QUFodHRwOi8vc29mdC51c2Fpa2EuY24vstnX98+1 ...