最近两天,一台ORACLE数据库的作业执行delete_ob_get_epps.sh脚本清理过期备份时,执行下面SQL语句就会被阻塞,在监控工具DPA里面部分截图如下(图片分开截断)

sql 'alter system archive log current';

如上截图所示,会话ID=650的EVENT为Log archive I/O,被阻塞的会话303在等待事件 enq:WL-contention 关于Log archive I/O的资料如下

Log archive I/O

 

Used local archiving of online redo logs (for a production database) or standby redo logs (for a standby database). When the archiving process exhausts its I/O buffers because all of them are being used for on-going I/O's, the wait for an available I/O buffer is captured in this system wait event.

Wait Time: Depends on the speed of the disks

Parameters: None

后面在metalink上找到相关资料:ALTER SYSTEM ARCHIVELOG CURRENT hangs on WL-enqueue (文档 ID 1209896.1),文档描述这是一个bug,这个生产系统为Oracle Database 10g Release 10.2.0.4.0 - 64bit Production,虽然这官方文档描述这个版本出现的版本为Oracle Database - Enterprise Edition - Version 10.2.0.5 and later。相信10.2.0.4可能也会存在这个问题, 具体信息如下:

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.2.0.5 and later
Information in this document applies to any platform.

SYMPTOMS

ALTER SYSTEM ARCHIVE LOG CURRENT hangs via SQL*Plus, but also during the RMAN-backup.
Therefor the BACKUP ARCHIVELOG ALL, never completes.

Another symptom is that V$ARCHIVE_LOG.APPLIED is not updated

CAUSE

The root-cause is unpublished bug 6113783 - ARC PROCESSES CAN HANG INDEFINITELY ON NETWORK

The session which is executing the ALTER SYSTEM  ARCHIVE LOG CURRENT is waiting for the event :
    'enq: WL - contention'

This session holding this enqueue seems to be hanging and therefor blocking the ARCHIVE LOG CURRENT to continue.

Get the blocker with :

SQL> select * from v$lock
     where v$lock.type = 'WL'
       and v$lock.lmode > 0
       and v$lock.block = 1;

The related process is :

SQL> select v$session.machine, v$session.process, v$session.program
     from v$session, v$lock
     where v$lock.sid = v$session.sid
       and v$lock.type = 'WL'
       and v$lock.lmode > 0
       and v$lock.block = 1;

SOLUTION

If the blocker is an archiver process (ARCx) than the issue is related to the unpublished bug 6113783 and is fixed in 11g Release2. (11.2.X)

Some patches exist for 11.1.0.7. Check Patch 6113783

The workaround for 10g is to kill the related archiver process on OS-level.

Unix:
% kill -9 <pid>

The archiver will be restarted automaticly.

如果取消执行归档当前日志,那么上面阻塞就会消息,如果再次执行alter system archive log current,就会又出现这个阻塞,具体相关信息如下

SQL> select * from v$lock

  2  where v$lock.type = 'WL'

  3     and v$lock.lmode > 0

  4    and v$lock.block = 1;

 

ADDR             KADDR                   SID TY        ID1        ID2      LMODE    REQUEST      CTIME      BLOCK

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

0000000409D991D8 0000000409D991F8        615 WL -2.115E+09  980630802          5          0      35788          1

 

SQL> select v$session.machine, v$session.process, v$session.program

  2  from v$session, v$lock

  3  where v$lock.sid = v$session.sid

  4  and v$lock.type = 'WL'

  5  and v$lock.lmode > 0

  6  and v$lock.block = 1;

 

MACHINE                               PROCESS      PROGRAM

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

getlnx01.gfg1.esquel.com               10790     rman@xxx.xxx.xxx.com (TNS V1-V3)

 

SQL> select sid, program from v$session where sid in (select sid from v$lock where sid=615);

 

       SID PROGRAM

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

      

       615 rman@xxx.xxx.xxx.com (TNS V1-V3)

然后我也测试验证了一下,取消执行归档当前日志操作,阻塞立马消失;执行切换redo log(alter system switch logfile),发现redo log又成功归档了。不会出现这个问题。但是比较奇怪的是之前没有出现这个问题。不清楚什么条件触发了这个bug。

参考资料

ALTER SYSTEM ARCHIVELOG CURRENT hangs on WL-enqueue (文档 ID 1209896.1)

ALTER SYSTEM ARCHIVELOG CURRENT挂起案例的更多相关文章

  1. alter system switch logfile与alter system archive log current的区别

    以前知道 ALTER SYSTEM SWITCH LOGFILE对单实例数据库或RAC中的当前实例执行日志切换, ALTER SYSTEM ARCHIVE LOG CURRENT会对数据库中的所有实例 ...

  2. alter system [switch logfile]与[archive log current]的区别

    --alter system [switch logfile]与[archive log current]的区别 ------------------------------------------- ...

  3. alter system archive log current作用及和alter system switch logfile区别

    alter system archive log current 是归档当前的重做日志文件,不管自动归档有没有打都归档. alter system switch logfile 是强制日志切换,不一定 ...

  4. orakill和ALTER SYSTEM KILL SESSION详解

    --orakill和ALTER SYSTEM KILL SESSION详解[转]-----------------------------------------2013/11/05 一个用户进程偶尔 ...

  5. alter system set events

    格式:alter system|session set events ‘[eventnumber|immediate] trace name eventname [forever] [, level ...

  6. alter system set events相关知识

    格式:alter system|session set events ‘[eventnumber|immediate] trace name eventname [forever] [, level ...

  7. ORACLE之手动注册监听listener。alter system set local_listener="XXX"

    记录下刚刚做的一个为一个数据库(t02)配置多个监听(listener)的实验,过程有点小曲折. (1)新增两个测试的监听,listener.ora的配置内容(可纯手动编辑该文件或使用netca)如下 ...

  8. alter system register

    alter system register的用法 1 Static Registration via set the listener.ora2 Dynamic Instance Registrati ...

  9. alter system register的用法

    转自 http://blog.csdn.net/njyxfw/article/details/7516143 今天一个同事问到我,有没动态注册监听的命令,查了下,找到了alter system reg ...

随机推荐

  1. 网络编程第三讲UDP编写

    网络编程第三讲UDP编写 一丶UDP简介 UDP是面向无连接的.就是说数据传输会丢掉.网络延时比较大的情况下.会早上丢包.例如视频通话.就是UDP UDP不需要建立建立. 下面有UDP编写流程图 下图 ...

  2. ES6躬行记(3)——解构

    解构(destructuring)是一种赋值语法,可从数组中提取元素或从对象中提取属性,将其值赋给对应的变量或另一个对象的属性.解构地目的是简化提取数据的过程,增强代码的可读性.有两种解构语法,分别是 ...

  3. java 8 双冒号运算符

    前言 java8增加了双冒号运算符.lambda本质上都是语法糖,学习过C#委托.匿名委托再理解java8中的双冒号运算符就容易多了.双冒号就是把方法当作参数传递给需要的方法,或者说是传递到strea ...

  4. μC/OS-II 任务堆栈的初始化

    任务堆栈的作用 应用程序在创建一个新任务的时候,必须把在系统启动这个任务时 CPU 各寄存器所需要的初始数据(任务指针.任务堆栈指针.程序状态字等等),事先存放在任务的堆栈中,以备任务切换等操作时调用 ...

  5. [JavaScript] 前端模块编程实现

    前端模块化 前端早期写代码都是全局变量满天飞,这种情况会造成全局命名空间污染,变量冲突等问题 var a = 1; var b = 2; function c(){} function d(){} 后 ...

  6. mongodb "Element '{0}' does not match any field or property of class" 异常的解决方法

    在序列化的对象上增加 [BsonIgnoreExtraElements]

  7. 【Java每日一题】20170310

    20170309问题解析请点击今日问题下方的“[Java每日一题]20170310”查看(问题解析在公众号首发,公众号ID:weknow619) package Mar2017; public cla ...

  8. 安装python3

    由于centos已经自带了python,但是没有python3,楼楼接下来自己去安装下.截止到本文python的最新版本为3.7.1,官网的地址为:https://www.python.org/ 下载 ...

  9. 我是这样搞懂一个神奇的BUG

    摘要: 通过分析用户的行为,才想得到为什么会出现这种情况! 前两天在BearyChat收到这样的一个报警消息: 409 ?Conflict ? 平时很少遇到这样的错误,貌似很严重的样子,吓得我赶紧查看 ...

  10. Ansible playbook roles

    1  概述 角色(roles):如果我们使用playbook写成一个文件,这个文件会很大,但是不方便组织,我们可以分组,把playbook根据功能,如handler,tasks等分门别类的放在在各自的 ...