Oracle oradebug中止、挂起LGWR进程(Suspend LGWR Process)

Oracle Core: Essential Internals for DBAs and Developers 书中有一段关于挂起LGWR进程的描述,实验如下:

--获取LGWR的pid

--10g以前
select
prc.pid,
bgp.name
from
v$bgprocess bgp,
v$process prc
where
bgp.name = 'LGWR'
and prc.addr = bgp.paddr;

--10g及以后
select prc.pid, prc.pname from v$process prc where prc.pname = 'LGWR';

--返回的pid为11,以下操作按时间顺序

--session1 中止lgwr进程
SQL> oradebug setorapid 11
Oracle pid: 11, Unix process pid: 2401, image: oracle@sean.ora11g (LGWR)
SQL> oradebug suspend   
Statement processed.

--session2 
SQL> insert into t values(1);
1 row created.

SQL> commit;
hang住

--session1
SQL> oradebug resume
Statement processed.

--session2
Commit complete.


总结:用户commit成功的前提条件是事务相关的log buffer都已经写入到磁盘online redo log中。将LGWR进程挂起,导致无法写log buffer,自然也就无法提交成功。

附:
LGWR进程从log buffer往online redo log写日志的5个场景:
用户提交事务;
在线日志发生切换;
每3秒;
redo log buffer 1/3满,或者缓存数据达到1m;
DBWn进程必须要写data buffer到磁盘。(在DBWn写data buffer到磁盘之前,与这些buffer修改相关的redo log必须先写到磁盘,write-ahead协议)。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值