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

news2024/11/16 7:41:09

所有的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>';

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1711537.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Unity SetParent第二个参数worldPositionStays的意义

初学Unity的小知识&#xff1a; 改变对象的父级有三种调用方式&#xff0c;如下&#xff1a; transMe.SetParent(transParent,true); transMe.SetParent(transParent,false); transMe.parent transParent;具体有什么区别呢&#xff0c;这里写一个测试例子来详细说明&#xff…

ROS2 Topics和Services

本文主要介绍ROS的Topics概念&#xff0c;如何创建Publisher和Subscriber&#xff0c;通过Topic在ROS程序间通信&#xff1b;介绍ROS的Services概念&#xff0c;如何创建Client和Server并建立通信。 更多内容&#xff0c;访问专栏目录获取实时更新。 ROS Topics Topics可以被视…

SQL数据库多层嵌套 json转sql建表语句,SQL数据库里数组里对象数据怎么创建

1. uniapp sqlite 一个数组包含对象嵌套对象通过主外键方式插入数据库&#xff1a; // 假设有一个对象数组&#xff0c;对象中包含嵌套对象 const objectsArray [{parentObject: {id: 1,name: Parent 1,// 其他父对象属性},childObject: {id: 11,parentId: 1,name: Child 1 o…

TOPSIS综合评价

TOPSIS法&#xff08;Technique for Order Preference by Similarity to an Ideal Solution&#xff09;是一种常用的综合评价方法&#xff0c;该方法根据有限个评价对象与理想化目标的接近程度进行排序&#xff0c;是在现有的对象中进行相对优劣的评价。 TOPSIS法的原理是通过…

Github 2024-05-29 C开源项目日报 Top10

根据Github Trendings的统计,今日(2024-05-29统计)共有10个项目上榜。根据开发语言中项目的数量,汇总情况如下: 开发语言项目数量C项目10C++项目3PHP项目1PHP:流行的Web开发脚本语言 创建周期:4710 天开发语言:C, PHP协议类型:OtherStar数量:37340 个Fork数量:7657 次…

SpringBoot 微服务中怎么获取用户信息 token

SpringBoot 微服务中怎么获取用户信息 token 当我们写了一个A接口&#xff0c;这个接口需要调用B接口&#xff0c;但是B接口需要包含请求头内容&#xff0c;比如需要用户信息、用户id等内容&#xff0c;由于不在同一个线程中&#xff0c;使用ThreadLocal去获取数据是无法获取的…

[java基础揉碎]文件IO流

目录 文件 什么是文件 文件流​编辑 常用的文件操作 创建文件方式一 创建文件方式二 创建文件方式三 tip:为什么new file 了还有执行createNewFile?new File的时候其实是在内存中创建了文件对象, 还没有在磁盘中, 当执行createNewFile的时候才是往磁盘中写入​编辑 …

申请的商标名称相同或近似,如何解决!

最近遇到一些首次申请注册商标的主体&#xff0c;基本想的名称都是两个字或或者两个字加通用词&#xff0c;还有用的行业描述词或缺乏显著特征词&#xff0c;这样去申请注册商标&#xff0c;普推知产老杨分析这样去直接申请注册大概率驳回。 两个字基本上注册的差不多了&#…

推券客CMS淘宝优惠券网站源码

推券客CMS淘宝优惠券网站源码是一个以PHPMySQL进行开发的PHP淘宝客优惠券网站。支持电脑站、手机站以及微信公众号查券。支持多级代理返利和阿里妈妈最新的渠道管理等功能。 五大优势 一、全开源 推券客cms网站程序数据库完全开源,目前市场上基本都是以下2种淘宝客系统 第一…

Redis:redis基础

Redis Remote Dictionary Service即远程字典服务 一个基于内存的key-value结构数据库,在开发中常常作为缓存存储不经常被改变的数据 基于内存存储,读写性能高 在企业中应用广泛 Redis介绍 用C语言开发的开源高性能键值对数据库,可以达到10w的qps,可以存储丰富的value类型…

从alpine构建预装vcpkg的docker image用于gitea actions CI

动机 想要构建一个基于vcpkg的交叉编译容器平台用于cpp项目的CI&#xff08;自动集成&#xff09;&#xff0c;此处仅提供最基础的image&#xff0c;amd64的机子上构建完成后大小为533兆&#xff08;着实不小&#x1f613;&#xff09;&#xff0c;各位看官可以在此基础上自行…

Gradle的学习

1.1 Gradle的优势 一款最新的&#xff0c;功能最强大的构建工具&#xff0c;用它逼格更高 使用Groovy或Kotlin代替XML&#xff0c;使用程序代替传统的XML配置&#xff0c;项目构建更灵活 丰富的第三方插件&#xff0c;让你随心所欲使用 完善Android,Java开发技术体系 1.2 …

Filebeat进阶指南:核心架构与功能组件的深度剖析

&#x1f407;明明跟你说过&#xff1a;个人主页 &#x1f3c5;个人专栏&#xff1a;《洞察之眼&#xff1a;ELK监控与可视化》&#x1f3c5; &#x1f516;行路有良友&#xff0c;便是天堂&#x1f516; 目录 一、引言 1、什么是ELK 2、FileBeat在ELK中的角色 二、Fil…

树莓派4B 学习笔记1:TF卡系统盘烧录_初次启动_远程端连接配置

今日开始学习树莓派4B 4G&#xff1a;&#xff08;Raspberry Pi&#xff0c;简称RPi或RasPi&#xff09; TF卡系统盘烧录_初次启动_远程端连接配置 目录 格式化SD卡&#xff1a; 烧录系统Win32DiskImager&#xff1a; Raspberry Pi Imager镜像烧写&#xff1a; 树莓派官网资料…

教育装备之先导小型五轴加工中心

随着制造业的快速发展和技术的不断进步&#xff0c;对高端技术人才的需求日益增长。五轴联动技术作为解决异性复杂零件高效优质加工问题的重要手段&#xff0c;受到了广泛关注。因此&#xff0c;培养掌握五轴联动技术的专业人才显得尤为重要。 先导小型五轴加工中心提供了真实的…

「数据结构」队列

目录 队列的基本概念 队列的实现 头文件queue.h 实现函数接口 1.初始化和销毁 2.出队列和入队列 3.获取队头元素和队尾元素 4.队列长度判空 后记 前言 欢迎大家来到小鸥的博客~ 个人主页&#xff1a;海盗猫鸥 本篇专题&#xff1a;数据结构 多谢大家的支持啦&#xff…

对比表征学习(一)Contrastive Representation Learning

对比表征学习&#xff08;二&#xff09;Sentence Embedding 主要参考翁莉莲的Blog&#xff0c;本文主要聚焦于对比损失函数 对比表示学习&#xff08;Contrastive Representation Learning&#xff09;可以用来优化嵌入空间&#xff0c;使相似的数据靠近&#xff0c;不相似的数…

玩转STM32-通用同步/异步收发器USART(详细-慢工出细活)

CPU与外围设备之间的信息交换或计算机与计算机之间的信息交换称为通信。基 本的通信方式有两种&#xff0c;即并行通信和串行通信。文章目录 一、串行通信基础1.1 串行通信的方式1.2 串行通信的数据传输形式1.3 波特率 二、STM32的USART的结构特征&#xff08;了解&#xff09;…

采集EthernetIP IO从站设备数据 转 profinet IO协议项目案例

1 文档说明 设置网关采集EthernetIP IO设备数据把采集的数据转成profinet IO协议转发给其他系统。 2 准备工作 仰科网关。支持采集EthernetIP IO数据&#xff0c;profinet IO协议转发。电脑。IP设置成192.168.1.198&#xff0c;和网关在同一个网段。网线、12V电源。 3 网关…

MySQL8报错Public Key Retrieval is not allowedz 怎么解决?

问题描述 当我们使用数据库管理工具连接mysql8的时候&#xff0c;可能遇到报错&#xff1a; Public Key Retrieval is not allowed 解决办法 1、在连接属性中配置allowPublicKeyRetrieval设置为true 2、在连接URL中加上配置allowPublicKeyRetrieval为true