热门标签 | HotTags
当前位置:  开发笔记 > 运维 > 正文

AIX6.1/11.2.0.3数据库上关于SWAP的一个BUG

昨天去南京某客户那里调优新上线的业务数据库,在查看alert.log日志时发现在过去的一段时间里,每过几个小时或间隔一段时间,就会报类以下的内容:ThuAug2109:01:262014WARNING:Heavyswappingobservedonsysteminlast5mins.pctofmemoryswappe

昨天去南京某客户那里调优新上线的业务数据库,在查看alert.log日志时发现在过去的一段时间里,每过几个小时或间隔一段时间,就会报类以下的内容: Thu Aug 21 09:01:26 2014WARNING: Heavy swapping observed on system in last 5 mins.pct of memory swappe

昨天去南京某客户那里调优新上线的业务数据库,在查看alert.log日志时发现在过去的一段时间里,每过几个小时或间隔一段时间,就会报类似以下的内容:
Thu Aug 21 09:01:26 2014 WARNING: Heavy swapping observed on system in last 5 mins. pct of memory swapped in [8.42%] pct of memory swapped out [2.16%]. Please make sure there is no memory pressure and the SGA and PGA are configured correctly. Look at DBRM trace file for more details.
Thu Aug 21 14:56:27 2014 WARNING: Heavy swapping observed on system in last 5 mins. pct of memory swapped in [5.40%] pct of memory swapped out [8.63%]. Please make sure there is no memory pressure and the SGA and PGA are configured correctly. Look at DBRM trace file for more details.
......
Sat Oct 18 22:13:48 2014 WARNING: Heavy swapping observed on system in last 5 mins. pct of memory swapped in [7.76%] pct of memory swapped out [0.33%]. Please make sure there is no memory pressure and the SGA and PGA are configured correctly. Look at DBRM trace file for more details.
客户的环境是IBM P570,AIX 6.1,安装了Oracle 11.2.0.3单实例数据库,物理内存64G,仅仅分配了20G给SGA,采用memory自动管理
查阅了一下MOS,发现是AIX平台上的一个bug,相关文档为:[1508575.1]
对应的数据库和平台:
Oracle Database - Enterprise Edition - Version 11.2.0.3 to 11.2.0.3 [Release 11.2] IBM AIX on POWER Systems (64-bit)
症状:

There is new warning message in alert.log in 11.2.0.3 similar to

WARNING: Heavy swapping observed on system in last 5 mins.
pct of memory swapped in [2.08%] pct of memory swapped out [0.12%].
Please make sure there is no memory pressure and the SGA and PGA
are configured correctly. Look at DBRM trace file for more details.

On AIX platform this message can be seen even when there is no virtual memory swapping at all. --物理内存足够,而且根本没有使用swap交换空间

You may compare the vmstat from AIX level with DBRM trace file entries to see the differences.


原因:

The issue is caused by unpublished Bug:14731911.

Swap usage messages are based on statistics that do not reflect the actual usage.

The v$osstat does not reflect proper stats for the swap space paging.

解决方法:

Apply Patch:11801934 on top of your IBM AIX on POWER Systems (64-bit) platform.

P.S: Bug is port-specific. --这个bug是针对端口指定的平台的

The issue is fixed in patchset 11.2.0.4 and release 12.1. --说是在12.1的patch中修复了,但实际上12.1还是会有这个问题,会有ora-700错误,详见文档:[ID 1919850.1]

来看一下BUG:14731911的描述:

Bug 属性


B - Defect
2 - Severe Loss of Service 11.2.0.3
96 - Closed, Duplicate Bug 212 - IBM AIX on POWER Systems (64-bit)
2012-10-8
2014-10-11 11801934
11.2.0.3 Port-Specific
Oracle 与此 Bug 相关的知识, 补丁程序和 Bug
\

相关产品


Oracle Database Products Oracle Database Suite
Oracle Database 5 - Oracle Database - Enterprise Edition
\
Hdr: 14731911 11.2.0.3 RDBMS 11.2.0.3 VOS PRODID-5 PORTID-212 11801934
Abstract: FALSE SWAP WARNING MESSAGES PRINTED TO ALERT.LOG ON AIX
 
*** 10/08/12 04:52 am ***
  
  
  BUG TYPE CHOSEN
  ===============
  Code
  
  SubComponent: Virtual Operating System
  ======================================
  DETAILED PROBLEM DESCRIPTION
  ============================
  Oracle process seems to check wrong OS local statistic (which include also
  FILESYSTEM caching etc.)
  
  Alert log shows WARNING: Heavy swapping observed on system in last 5 mins.
  pct of memory swapped in [2.08%] pct of memory swapped out [0.12%].
  Please make sure there is no memory pressure and the SGA and PGA 
  are configured correctly. Look at DBRM trace file for more details.
  
  but this is not reflected at OS level.
  
  DIAGNOSTIC ANALYSIS
  ===================
  1. nmon shows virtual memory swapping does not occur at all - see attached file --nmon根本没有监控到swap动作
  
  2. Oracle Database Server is 11.2.0.3 and contains fix for 10220118
  
  3. Server configuration
  real mem: 144GB
  lowest value of fre memory : 87,65 GB --剩余内存充足
  
  4. DBRM seems to use a wrong OS statistics - trace file is attached
  
  WORKAROUND?
  ===========
  No
  
  TECHNICAL IMPACT
  ================
  Wrong diagnostic analyze.
  Message is bothering customer's DBA when in fact the warning message is
  misleading
  
  RELATED ISSUES (bugs, forums, RFAs)
  ===================================
  http://myforums.oracle.com/jive3/thread.jspa?threadID=1104581 
  10220118
  
  HOW OFTEN DOES THE ISSUE REPRODUCE AT CUSTOMER SITE?
  ====================================================
  Always
  
  DOES THE ISSUE REPRODUCE INTERNALLY?
  ====================================
  No
  
  EXPLAIN WHY THE ISSUE WAS NOT TESTED INTERNALLY.
  ================================================
  Unavailable Data Volume
  
  IS A TESTCASE AVAILABLE?
  ========================
  No
  
  Link to IPS Package:
  ====================
  not available

DBRM(Database Resource Manager)是11gR2中新特性中出现的后台进程,会在alert.log告警日志中反映OS操作系统最近5分钟是否有剧烈的swap活动,而在AIX平台上,由于BUG:14731911的存在,oracle的这个进程谎报了内存进行了swapin和swapout动作。我们知道,只有当物理内存真的不够用的情况下,才会去用swap(通常会配置成物理内存的2倍),而swap是非常耗费性能的(从物理磁盘读写)。但是个人认为这个bug的危害性并不大,仅仅只是在alert.log日志中报了一个WARNING,并没有因为这个影响导致对数据库更加负面的影响,因此是否打补丁到11.2.0.4就见仁见智了,如果想让alert.log平安无事,那么就可以升级一下patch。当然了,如果真的是因为OS内存吃紧造成的swap动作,就要区别对待了,因为此时的确会对数据库造成严重影响。要区分是否真的内存不足而非系统误报,那么主要还是通过nmon,topas,vmstat等监控工具来进行分析(linux下还可以用free监控)

对于AIX平台,其实还有另一个bug,只不过是unpublished base bug,而不是port-specific bug

AIX Platform

If your Platform is IBM-AIX then this is not the only possible reason for this alert log message.
For IBM AIX on POWER Systems (64-bit), there is also next known port-specific bug:
Bug 14731911 - FALSE SWAP WARNING MESSAGES PRINTED TO ALERT.LOG ON AIX
with unpublished base bug:
Bug 11801934 : WRONG PAGE-IN AND PAGE-OUT OS VM STATS IN AIX.

在vmware平台中的这个WARNING信息,如果不是bug引起,则很有可能和ora-04031/ora-04030相关,这个就严重多了

VMWare

Under VMWare, the messages may perhaps indicate a more serious issue, even when no memory related ORA-4031/ORA-4030 errors are reported.
Under circumstances, an instance in a virtual machine may be simply terminated by PMON due to error 471 without further errors in the alert log.
The OS logs may in such case report an out of memory condition like below:

[root@vmh ~]# grep Kill /var/log/messages*
/var/log/messages-20140629:Jun 27 18:29:06 vmh-msfc-dodp02 kernel: [1895074.304941] Out of memory: Kill process 42094 (oracle) score 391 or sacrifice child
/var/log/messages-20140629:Jun 27 18:29:06 vmh-msfc-dodp02 kernel: [1895074.305203] Killed process 42094, UID 303, (oracle) total-vm:189081588kB, anon-rss:27412kB, file-rss:109612

通常解决OS内存swap问题有以下几种方案:

1. 诊断是否存在内存泄露的进程,解决内存泄露 2. 调优SGA/PGA,减少oracle对内存的占用 3. 利用/proc/sys/vm/drop_caches,暂时释放一些cache的内存(Linux) 4. 调整系统VM内存管理参数, 例如Linux上sysctl.conf中的以下几个参数:


vm.min_free_kbytes:Raising the value in /proc/sys/vm/min_free_kbytes will cause the system to start reclaiming memory at an earlier time than it would have before.

vm.vfs_cache_pressure:At the default value of vfs_cache_pressure = 100 the kernel will attempt to reclaim dentries and inodes at a “fair” rate with respect to pagecache and swapcache reclaim. Decreasing vfs_cache_pressure causes the kernel to prefer to retain dentry and inode caches. Increasing vfs_cache_pressure beyond 100 causes the kernel to prefer to reclaim dentries and inodes.


vm.swappiness:default 60,Apparently /proc/sys/vm/swappiness on Red Hat Linux allows the admin to tune how aggressively the kernel swaps out processes'memory. Decreasing the swappiness setting may result in improved Directory performance as the kernel holds more of the server process in memory longer before swapping it out.

设置以下值,以减少OOM(Out Of Memory)的可能性:

# Oracle-Validated setting for vm.min_free_kbytes is 51200 to avoid OOM killer
vm.min_free_kbytes = 51200
vm.swappiness = 40
vm.vfs_cache_pressure = 200



推荐阅读
  • 近年来,大数据成为互联网世界的新宠儿,被列入阿里巴巴、谷歌等公司的战略规划中,也在政府报告中频繁提及。据《大数据人才报告》显示,目前全国大数据人才仅46万,未来3-5年将出现高达150万的人才缺口。根据领英报告,数据剖析人才供应指数最低,且跳槽速度最快。中国商业结合会数据剖析专业委员会统计显示,未来中国基础性数据剖析人才缺口将高达1400万。目前BAT企业中,60%以上的招聘职位都是针对大数据人才的。 ... [详细]
  • 本文介绍了数据库的存储结构及其重要性,强调了关系数据库范例中将逻辑存储与物理存储分开的必要性。通过逻辑结构和物理结构的分离,可以实现对物理存储的重新组织和数据库的迁移,而应用程序不会察觉到任何更改。文章还展示了Oracle数据库的逻辑结构和物理结构,并介绍了表空间的概念和作用。 ... [详细]
  • 本文介绍了Oracle数据库中tnsnames.ora文件的作用和配置方法。tnsnames.ora文件在数据库启动过程中会被读取,用于解析LOCAL_LISTENER,并且与侦听无关。文章还提供了配置LOCAL_LISTENER和1522端口的示例,并展示了listener.ora文件的内容。 ... [详细]
  • 本文详细介绍了Linux中进程控制块PCBtask_struct结构体的结构和作用,包括进程状态、进程号、待处理信号、进程地址空间、调度标志、锁深度、基本时间片、调度策略以及内存管理信息等方面的内容。阅读本文可以更加深入地了解Linux进程管理的原理和机制。 ... [详细]
  • 图解redis的持久化存储机制RDB和AOF的原理和优缺点
    本文通过图解的方式介绍了redis的持久化存储机制RDB和AOF的原理和优缺点。RDB是将redis内存中的数据保存为快照文件,恢复速度较快但不支持拉链式快照。AOF是将操作日志保存到磁盘,实时存储数据但恢复速度较慢。文章详细分析了两种机制的优缺点,帮助读者更好地理解redis的持久化存储策略。 ... [详细]
  • 本文介绍了在Linux下安装Perl的步骤,并提供了一个简单的Perl程序示例。同时,还展示了运行该程序的结果。 ... [详细]
  • 本文介绍了在Mac上搭建php环境后无法使用localhost连接mysql的问题,并通过将localhost替换为127.0.0.1或本机IP解决了该问题。文章解释了localhost和127.0.0.1的区别,指出了使用socket方式连接导致连接失败的原因。此外,还提供了相关链接供读者深入了解。 ... [详细]
  • 计算机存储系统的层次结构及其优势
    本文介绍了计算机存储系统的层次结构,包括高速缓存、主存储器和辅助存储器三个层次。通过分层存储数据可以提高程序的执行效率。计算机存储系统的层次结构将各种不同存储容量、存取速度和价格的存储器有机组合成整体,形成可寻址存储空间比主存储器空间大得多的存储整体。由于辅助存储器容量大、价格低,使得整体存储系统的平均价格降低。同时,高速缓存的存取速度可以和CPU的工作速度相匹配,进一步提高程序执行效率。 ... [详细]
  • Webmin远程命令执行漏洞复现及防护方法
    本文介绍了Webmin远程命令执行漏洞CVE-2019-15107的漏洞详情和复现方法,同时提供了防护方法。漏洞存在于Webmin的找回密码页面中,攻击者无需权限即可注入命令并执行任意系统命令。文章还提供了相关参考链接和搭建靶场的步骤。此外,还指出了参考链接中的数据包不准确的问题,并解释了漏洞触发的条件。最后,给出了防护方法以避免受到该漏洞的攻击。 ... [详细]
  • Linux磁盘的分区、格式化的观察和操作步骤
    本文介绍了如何观察Linux磁盘的分区状态,使用lsblk命令列出系统上的所有磁盘列表,并解释了列表中各个字段的含义。同时,还介绍了使用parted命令列出磁盘的分区表类型和分区信息的方法。在进行磁盘分区操作时,根据分区表类型选择使用fdisk或gdisk命令,并提供了具体的分区步骤。通过本文,读者可以了解到Linux磁盘分区和格式化的基本知识和操作步骤。 ... [详细]
  • 本文介绍了Linux系统中正则表达式的基础知识,包括正则表达式的简介、字符分类、普通字符和元字符的区别,以及在学习过程中需要注意的事项。同时提醒读者要注意正则表达式与通配符的区别,并给出了使用正则表达式时的一些建议。本文适合初学者了解Linux系统中的正则表达式,并提供了学习的参考资料。 ... [详细]
  • Ubuntu 9.04中安装谷歌Chromium浏览器及使用体验[图文]
    nsitionalENhttp:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd ... [详细]
  • 如何在服务器主机上实现文件共享的方法和工具
    本文介绍了在服务器主机上实现文件共享的方法和工具,包括Linux主机和Windows主机的文件传输方式,Web运维和FTP/SFTP客户端运维两种方式,以及使用WinSCP工具将文件上传至Linux云服务器的操作方法。此外,还介绍了在迁移过程中需要安装迁移Agent并输入目的端服务器所在华为云的AK/SK,以及主机迁移服务会收集的源端服务器信息。 ... [详细]
  • 本文讨论了在数据库打开和关闭状态下,重新命名或移动数据文件和日志文件的情况。针对性能和维护原因,需要将数据库文件移动到不同的磁盘上或重新分配到新的磁盘上的情况,以及在操作系统级别移动或重命名数据文件但未在数据库层进行重命名导致报错的情况。通过三个方面进行讨论。 ... [详细]
  • imx6ull开发板驱动MT7601U无线网卡的方法和步骤详解
    本文详细介绍了在imx6ull开发板上驱动MT7601U无线网卡的方法和步骤。首先介绍了开发环境和硬件平台,然后说明了MT7601U驱动已经集成在linux内核的linux-4.x.x/drivers/net/wireless/mediatek/mt7601u文件中。接着介绍了移植mt7601u驱动的过程,包括编译内核和配置设备驱动。最后,列举了关键词和相关信息供读者参考。 ... [详细]
author-avatar
ar_wen2402851455
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有