当前位置: 首页 > news >正文

Oracle dblink 发现Network 等待事件的分析 enq: KO - fast object checkpoint

所有的sql 通过dblink 查询全部等待中,

同一个SQL 20多个session 在跑,等待事件network,可能怀疑是不是网络断开了,导致没有返回

执行sql 如下:

BEGIN X@dblink ; END;

去到dblink 所在的db,发现20多个sql在执行一个sql,等待事件fast object check point

发现同一个sql的两个执行计划,最终发现PK index失效导致。

The following SELECT Statement shows different elapsed time from the original database to the coloning database.

For the excution plan, database parameters and rows of table are same on two databases.

SELECT *
FROM xxx MMT
WHERE mmt.xxx_id = 1661


1. On Original database: elapsed time is 10s.

2. On cloning database: elapsed time is 72s. 

The direct path read wait event from cloning database consumes 65s in the below 10046 trace.

call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.04 0.03 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 7.75 72.17 611660 612506 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 4 7.79 72.21 611660 612506 0 1

Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 173
Number of plan statistics captured: 1

Rows (1st) Rows (avg) Rows (max) Row Source Operation
---------- ---------- ---------- ---------------------------------------------------
  1 1 1 TABLE ACCESS FULL xxx (cr=612506 pr=611660 pw=0 time=0 us cost=167711 size=277 card=1)


Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 2 0.00 0.00
SQL*Net more data to client 1 0.00 0.00
enq: KO - fast object checkpoint 1 0.00 0.00
direct path read 38390 0.45 65.02 <<<<<<<<<<<<<<< direct path read : 65s
SQL*Net message from client 2 37.56 37.56

enq: KO - fast object checkpoint 1 0.00 0.00 --SGA 压力 不足

1.

"enq: KO - fast object checkpoint" is a wait event that is waiting until the checkpoints finishes in a particular object level.
At checkpoints, dirty buffers(updated buffers) on the buffer cache has to be written out to the disk by DBWR.
This checkpoint occurs by object level so if the process is not related to this particular object, the client should not have a delay from it.
However when DBWR process is under high load, it might affect to the performance.

2. 

All reporting queries are doing full table scans concurrently. Oracle uses direct path reads instead of db file scattered reads. And direct path reads require a checkpoint
 

SOLUTION

"_serial_direct_read"=NEVER

 WARNING: This solution is for non-Exadata system only. On Exadata system please don't disable direct path reads as it is critical to SmartIO benefits.

3. 就是cache不足, keep为0 所以不停的读盘

  • EM displays a huge amount of 'Application' and 'Other' on the 'Average active sessions' chart compared to normal
  • CKPT process consistently high in the process list
  • AWR top 5 wait events show :
    • "enq: KO - fast object checkpoint"
    • "reliable message"
  • ASH report Top SQL with Top Events shows queries with high waits on "enq: KO - fast object checkpoint"
  • A review of the tables in the query revealed that the table is defined to use the keep cache:

    ...
    STORAGE(INITIAL 327680 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
    PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1
    BUFFER_POOL KEEP FLASH_CACHE    <<<######
    DEFAULT CELL_FLASH_CACHE DEFAULT)

  • The Initialization  parameters section in AWR report indicate that DB_KEEP_CACHE_SIZE was not set,

CAUSE

Tables involved in the process that is waiting on these events have buffer_pool = keep but the keep buffer pool was not configured on these instances.
Altering these tables to use the default buffer pool resolved the issue.

This issue was due to the excessive direct path reads that occurred as a result of the misconfiguration explained above and is dealt with in:
Bug 12530276 High 'direct path read' waits when buffer pools are not setup.
 

SOLUTION

1. The bug is fixed in 11.2.0.3

2. Workarounds:

  • Change the object definitions with keep buffer cache to use the default buffer cache
  • Allocate a keep buffer pool by setting parameter DB_KEEP_CACHE_SIZE to a non-zero value

CHANGES

CAUSE

It's due to buffer cache overflow on cloning database. So, the query become slow when data reads from the disk.

Note : The SGA_SIZE is 32G. However the the current usage of buffer cache(__db_cache_size) reaches to 30G. So, It indicted that buffer cache was almost fully used by other hot data.

SOLUTION

Options:

1. Flush buffer cache only when it's a test server.

    sqlplus / as sysdba


   SQL> alter system flush buffer_cache;

 - or -

2. keep the data of table into keep buffer cache

-- Check the table size
select BYTES/1024/1024 as SIZE_MB , table_name, owner from dba_segments where table_name = '<TABLE_NAME>';


-- Check KEEP buffer cache size


select component, current_size
from v$memory_dynamic_components
where component = 'KEEP buffer cache';


-- Increase keep buffer cache size if needed


alter system set db_keep_cache_size = 500m scope=both;

Note: the size 500m is an example.



-- Keep whole data of table into keep buffere cache
alter table <TABLE_NAME> storage( buffer_pool keep);

-- Check the table whether in keep buffer cache
select buffer_pool
from dba_tables
where table_name = '<TABLE_NAME>';

相关文章:

  • 北京网站建设多少钱?
  • 辽宁网页制作哪家好_网站建设
  • 高端品牌网站建设_汉中网站制作
  • 【权威出版】2024年电气工程与传感检测技术国际会议(EESDT 2024)
  • 从输入URL到页面加载的全过程
  • 书籍学习|基于SprinBoot+vue的书籍学习平台(源码+数据库+文档)
  • mysql存储地理信息的方法
  • jmeter之MD5加密接口请求教程
  • C语言-atoi()库函数的模拟实现
  • 摩尔投票法——代码实现及注释(力扣169题:找出列表中多数元素)
  • 源码编译安装LAMP
  • R可视化:另类的箱线图
  • Vue3实战笔记(47)— 一探emit奥秘——组件间通信的艺术与实践
  • React 微信扫码登陆网页
  • iOS推送证书过期处理
  • Java:String、StringBuffer和StringBuilder的区别
  • linux安装python第三方库情况
  • 防火墙基础基础篇:NAT转发功能之——Easy IP方式详解
  • 002-读书笔记-JavaScript高级程序设计 在HTML中使用JavaScript
  • 08.Android之View事件问题
  • Android交互
  • Android组件 - 收藏集 - 掘金
  • CSS相对定位
  • egg(89)--egg之redis的发布和订阅
  • ES6, React, Redux, Webpack写的一个爬 GitHub 的网页
  • Java 内存分配及垃圾回收机制初探
  • JavaScript 基础知识 - 入门篇(一)
  • JavaScript类型识别
  • java第三方包学习之lombok
  • Leetcode 27 Remove Element
  • Mocha测试初探
  • nodejs:开发并发布一个nodejs包
  • OpenStack安装流程(juno版)- 添加网络服务(neutron)- controller节点
  • react-native 安卓真机环境搭建
  • React-生命周期杂记
  • SQLServer插入数据
  • Vue.js源码(2):初探List Rendering
  • 从零开始的webpack生活-0x009:FilesLoader装载文件
  • 飞驰在Mesos的涡轮引擎上
  • 干货 | 以太坊Mist负责人教你建立无服务器应用
  • 基于OpenResty的Lua Web框架lor0.0.2预览版发布
  • 聚类分析——Kmeans
  • 理解在java “”i=i++;”所发生的事情
  • 前端每日实战:70# 视频演示如何用纯 CSS 创作一只徘徊的果冻怪兽
  • 使用Tinker来调试Laravel应用程序的数据以及使用Tinker一些总结
  • 一、python与pycharm的安装
  • 一些css基础学习笔记
  • ​如何使用ArcGIS Pro制作渐变河流效果
  • #NOIP 2014# day.1 生活大爆炸版 石头剪刀布
  • $.each()与$(selector).each()
  • (3)(3.2) MAVLink2数据包签名(安全)
  • (算法)大数的进制转换
  • *++p:p先自+,然后*p,最终为3 ++*p:先*p,即arr[0]=1,然后再++,最终为2 *p++:值为arr[0],即1,该语句执行完毕后,p指向arr[1]
  • ./configure,make,make install的作用
  • .bat批处理(七):PC端从手机内复制文件到本地
  • .net 4.0 A potentially dangerous Request.Form value was detected from the client 的解决方案
  • .NET Core引入性能分析引导优化
  • .NET6 命令行启动及发布单个Exe文件