等待事件 enq: KO - fast object checkpoint可行的一些处理方法

查看相关文档:


You see this event because object level checkpoint which happens when you run direct path reads on a segment (like with serial direct read full table scan or parallel execution full segment scans).
Now the question is how much of your sessions response time is spent waiting for that event - and whether the winning in query speed due direct read/parallel execution outweighs the time spent waiting for this checkpoint.
Waiting for KO enqueue - fast object checkpoint means that your session has sent CKPT process a message with instruction to do object level checkpoint and is waiting for a reply.
CKPT in turn asks DBWR process to perform. the checkpoint and may wait for response.
So you should check what the DBWR and CKPT processes are doing - whether they're stuck waiting for something (such controlfile enqueue) or doing IO or completely idle.
该等待事件是由于当进行TABLE FULL SCAN或并行查询整个段时,对象级别发生checkpoint,由于direct path read必须要从磁盘中读入到PGA中,因此必须等待checkpoint完成,将脏块写回磁盘。相当于写阻塞了读。当发生该等待事件,一个简单的查询就将变得非常慢。


1.查看检查点及写入进程


select sid,program from v$session where program like '%CKPT%' or program like '%DBW%';


2.查看这两个进程等待的内容


select sid,event,state,p1,p2,p3,seconds_in_wait from v$session_wait where sid in (select sid from v$session where program like '%CKPT%' or program like '%DBW%');


3.发现 db file async I/O submit 等待事件


一些可行的解决方法:
 

调整数据库参数

1 调整异步IO

2 增加日志组 <<<<看日志自身状态确定

3 增加DB writer数量 <<<<IO撑不住,这个效果一般

4 解决存储自身问题

调整业务SQL

5 调优SQL消除全表扫和大排序 <<<<<核心解决方法

如果多数业务频繁大表扫描,无法避免,建议关闭该功能,此时内存压力会增大,CPU也会有压力,需要了解这些资源情况

6 调整隐藏参数

"_serial_direct_read"=NEVER

SYS@orcl1>SELECT ksppinm, ksppstvl, ksppdesc FROM x$ksppi x, x$ksppcv y WHERE x.indx = y.indx AND ksppinm ='_serial_direct_read';

KSPPINM KSPPSTVL KSPPDESC

------------------------- ------------------------------ ----------------------------------------------------

_serial_direct_read auto enable direct read in serial

修改隐藏参数

alter system set "_serial_direct_read"=never;

处理 "enq: TX - allocate ITL entry" 等待事件方法如下: 1. 调整事务的设计:如果事务设计不合理,可能导致频繁地请求 ITL 条目,从而引起 "enq: TX - allocate ITL entry" 等待事件。因此,可以通过调整事务的设计来减少对 ITL 条目的需求。 2. 增加 ITL 条目:如果数据库中经常出现 "enq: TX - allocate ITL entry" 等待事件,可能是因为 ITL 条目的数量不足,无法满足并发事务的需求。此时,可以通过增加数据块的大小或者增加 INITRANS 参数的值来增加 ITL 条目的数量。 3. 调整 INITRANS 参数:INITRANS 参数指定了在数据块中分配给 ITL 条目的初始数目。如果 INITRANS 参数的值太小,可能会导致 ITL 条目不足,从而引起 "enq: TX - allocate ITL entry" 等待事件。因此,可以通过增加 INITRANS 参数的值来增加 ITL 条目的数量。 4. 增加数据库缓存:如果数据库缓存不足,可能会导致频繁的磁盘 I/O 操作,从而引起 "enq: TX - allocate ITL entry" 等待事件。因此,可以通过增加数据库缓存的大小来减少磁盘 I/O 操作。 5. 优化 SQL 语句:如果 SQL 语句执行效率低下,可能会导致事务持有锁的时间过长,从而引起 "enq: TX - allocate ITL entry" 等待事件。因此,可以通过优化 SQL 语句来减少事务持有锁的时间。 需要注意的是,如果 "enq: TX - allocate ITL entry" 等待事件出现较为频繁,可能会影响数据库的性能和稳定性,因此应该及时采取措施进行处理
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值