首页 > 其他分享 >热块及毛刺问题定位

热块及毛刺问题定位

时间:2023-10-16 20:32:16浏览次数:35  
标签:定位 exec 毛刺 time sample xxxxxxxxx 热块 sql id

1. 查看活动会话最高的时间点和SAMPLE_ID

select sample_id,sample_time,count(*)
  from v$active_session_history a
where sample_time between to_date('xxxxxxxxx','yyyymmddhh24miss') and to_date('xxxxxxxxx','yyyymmddhh24miss')
  group by sample_id,sample_time
  order by 3 desc;

2. 如果是xxxx库DEADLOCK问题使用以下脚本处理,不是DEADLOCK问题跳到3

select sql_id,event,count(*)
  from v$active_session_history a
where sample_id=xxxxxxxxx
  and event='buffer deadlock'
 group by sql_id,event
 order by 3 desc

2.1定位到执行计划慢在哪一行

select sql_id,sql_plan_hash_value,sql_plan_line_id,event,count(*)
  from v$active_session_history a
where sample_id=xxxxxxxxx
  and sql_id='5zzddv8mwnmpk'
  and event is not null
 group by sql_id,sql_plan_hash_value,sql_plan_line_id,event
 order by 5 desc;

2.2 登录平台查看SQL执行计划定位到热块的对象,比如说SQL_PLAN_LINE_ID=9

热块及毛刺问题定位_故障定位

3.使用SAMPLE_ID或者SAMPLE_TIME查看数据库TOP EVENT和TOP SQL

select event,count(*)
  from v$active_session_history a
where sample_id = xxxxxxxxx
 group by event
 order by 2 desc;

select sql_id,count(*)
  from v$active_session_history a
where sample_time between to_date('xxxxxxxxx','yyyymmddhh24miss') and to_date('xxxxxxxxx','yyyymmddhh24miss')
 group by sql_id
 order by 2 desc;

4. 关注SQL_EXEC_ID,如果长时间都是同一个,说明这个SQL执行了很久没有结束,可以结合SQL_EXEC_START判断出SQL执行时间

select sql_id,count(*),sample_time,sql_exec_start,sql_exec_id
  from v$active_session_history a
where sample_time between to_date('xxxxxxxxx','yyyymmddhh24miss') and to_date('xxxxxxxxx','yyyymmddhh24miss')
  and sql_id in ('xxxxxxxxx')
 group by sql_id,sample_time,sql_exec_start,sql_exec_id
 order by 3

5. 关注DURATION,SQL执行时间是否有变化

select sql_id,sample_time,sql_plan_hash_value, max(sample_time) - SQL_EXEC_START as duration,sql_exec_start,sql_exec_id,min(sql_exec_start)--machine,program,
  from v$active_session_history a
where sample_time between to_date('xxxxxxxxx','yyyymmddhh24miss') and to_date('xxxxxxxxx','yyyymmddhh24miss')
   and sql_id in ('xxxxxxxxx')
  group by sql_id,sql_exec_id,sql_plan_hash_value,sql_exec_start,sample_time--,machine,program
  order by 4 desc;

标签:定位,exec,毛刺,time,sample,xxxxxxxxx,热块,sql,id
From: https://blog.51cto.com/u_13482808/7893448

相关文章

  • RTK高精度定位安全帽-UWB室内定位/GPS定位智能安全帽技术方案
    高精度RTK定位安全帽是一种综合性解决方案,结合了先进的GPS定位技术、物联网技术、移动数据传输和智能执法管理。相较于传统的定位安全帽,它提供了更高的定位精度、更强大的数据处理能力和更全面的施工过程记录,对公共安全领域有着实质性的积极影响。该安全帽采用厘米级RTK定......
  • 定位元素封装find_element(增加显性等待等)
     封装#find_elementUtil.pyimportosimporttimefromselenium.webdriver.supportimportexpected_conditionsasECfromappium.webdriver.common.appiumbyimportAppiumByfromselenium.webdriver.support.waitimportWebDriverWait#frombaseimportdriver_......
  • 定位控制元素水平垂直居中
    浏览器中盒子的位置1.使用绝对元素,相对于浏览器第一窗口进行50%的距离设置,盒子会移动到第四象限; 再使用外边距设置让盒子移动到中间位置(注意正负值的设置)*{margin:0;padding:0;}div{width:200px;height:200px;......
  • vue框架,input相同标签如何定位-label定位
    一、问题提出:后台前端框架改版,之前是angularjs,现在用vue,导致input标签定位失败,只能定位到第一个input标签,查看后台源代码发现这两个标签是一模一样,如下图:二、问题思考过程1.为什么以前的版本可以定位成功,而现在的就定位不了啦查阅之前版本的这部分定位代码,发现原来的框架是......
  • 定位SQL慢查询
    一、概念MySQL的慢查询(慢查询日志):是MySQL提供的一种日志记录,用来记录在MySQL中响应时间超过阈值的语句。具体环境中,运行时间超过long_query_time值的SQL语句,则会被记录到慢查询日志中。long_query_time的默认值为10,意思是记录运行10秒以上的语句。默认情况下,MySQL数据库并不启......
  • 使用 KubeSkoop exporter 监测和定位容器网络抖动问题
    作者:遐宇、溪恒本文是8月17日直播的文字稿整理,文末可观看直播回放。除去文章内容外,还包括针对实际网络问题的实战环节。容器网络抖动问题发生频率低,时间短,是网络问题中最难定位和解决的问题之一。不仅如此,对Kubernetes集群内的网络状态进行日常的持续性监测,也是集群运维中很......
  • 使用 KubeSkoop exporter 监测和定位容器网络抖动问题
    作者:遐宇、溪恒本文是8月17日直播的文字稿整理,文末可观看直播回放。除去文章内容外,还包括针对实际网络问题的实战环节。容器网络抖动问题发生频率低,时间短,是网络问题中最难定位和解决的问题之一。不仅如此,对Kubernetes集群内的网络状态进行日常的持续性监测,也是集群运维......
  • 智慧工厂中的UWB定位技术及其在人员安全管理中的应用
    位置信息大数据定位平台源码 UWB高精度人员定位系统源码智慧工厂是产业升级的外在表现形式,利用物联网技术加强信息管理的新模式,人员定位管理通过物联网技术、位置信息大数据的综合处理应用,在智慧工厂人员管理方面具有独到的优势。UWB定位技术具有传输速率高,发射功率低,传统能力强等......
  • Android Studio可以编译但Flutter提示无法定位java runtime
    AndroidStudio可以编译但Flutter提示无法定位javaruntime下面我们重点讲一下“UnabletofindbundledJavaversion”报错问题到AndroidStudio安装目录下注意:有些AndroidStudio可能是“jbr”文件,不用管jbr文件,直接复制一份jbr文件在同一路经,再把复制的文件改名为“jre”文......
  • Visual Studio 2019 快速定位代码的位置
              ......