5Moracle 11.2.0.4 rac环境,业务主要连接在节点1。
redhat linux 6.5操作系统。2C12core 64G
1、最近业务人员反应应用系统慢,点击按钮半天无反应
2、收集awr及ash信息如附件
3、查看osw日志确实发现data磁盘在高峰期处于busy状态。但是await延迟较低。
麻烦各位专家给出些意见?是否是硬件资源性能不足导致的?还是sql编写的问题?
评论
有用 0
评论
有用 0
评论
有用 0
评论
有用 0大量动态采用sql占用io比较多
可以试试关闭动态采样功能
Enabling and Disabling Automatic Optimizer Statistics Collection
评论
有用 0ASSP_CLOB_VOUCHER_STAMP_2020 表的 id列有没有索引?
评论
有用 0Enabling and Disabling Automatic Optimizer Statistics Collection 这是是晚上22点才开始执行的,应该不影响白天的业务
评论
有用 0应该尝试确定SQL中执行大量缓冲区获取和执行计划的语句,这些SQL中含有read by other session等待对应扫描的对象,通常这种执行时间都蛮长的,还要综合db file scattered read、db file sequential read相关的等待SQL去排查。
评论
有用 0你看你的top sql里全是动态采样的sql,默认10g以后optimizer_dynamic_sampling参数为level 2,一般为缺失统计信息会造成每次使用动态采样,虽然动态采样会在表频繁发生大批量改变时,一般可以生成更好的执行计划,但是也不往往是这样,所以看看 “ASSP2”."ASSP_CLOB_VOUCHER_STAMP_2020"表为什么相关SQL都走动态采样?
下面为该参数级别解释Mos(Doc ID 336267.1):
The parameter OPTIMIZER_DYNAMIC_SAMPLING controls the level of sampling performed by the optimizer.
In simplified form, the Levels have the following effects:
Level 0: Disables dynamic sampling.
Level 1: Sample all tables that have not been analyzed that meet certain criteria.
Level 2: Apply dynamic sampling to all unanalyzed tables. (Default from 10g)
Level 3: As per Level 2, plus all tables for which standard selectivity estimates used a guess for some predicate that is a potential dynamic sampling predicate.
Level 4: As per Level 3, plus all tables that have complex predicate expressions (for example single-table predicates that reference 2 or more columns or non-equality where clause predicates on two correlated columns).
Level 5-9: As per Level 4 with a larger sample size each time.
Level 10: Use dynamic sampling for all statements sampling All blocks
评论
有用 0根据等待事件把SQL抓出来,给优化了,才能根本上解决问题。
评论
有用 01.数据库等待时间event占比最高是read by other session ,这个意思是一个会话a执行查询blocks,正在被另一个会话从磁盘读取到内存中,我的会话a只需要等待即可,到时候从内存中获取记录;
2.观察top sql SQL ordered by Reads
Captured SQL account for 100.2% of Total
基本上物理读都包含在top sql中,top sql占比最高的两条sql 6suqju7ut3vub,dbfmq27nhyn29 均为动态采样的SQL对象为"ASSP2".“ASSP_CLOB_VOUCHER_STAMP_2020”

这个对象检索可以发现有sql 执行这个对象相关的sql;
3.建议
3.1先确认这个表有没有合适的统计信息,是否是简单的由于表没有统计信息造成执行sql需要执行动态采样,手工收集下表的统计信息
3.2 采用之前同事的方法,检查参数是否修改optimizer_dynamic_sampling
3.3 采用之前同事的方法,禁用动态采样
评论
有用 1
墨值悬赏


