SQL2043N 与 linux的randomize_va_space特性
自从数据库服务器从redhat4.6升级到redhat5.5之后,在使用TSM备份的时候偶尔会出现SQL2043N
查看错误:
[db2inst1@limt ~]$ db2 ? SQL2043N SQL2043N Unable to start a child process or thread.
Explanation:
Unable to start up the child processes or threads required during the
processing of a database utility. There may not be enough available
memory to create the new process or thread. The utility stops
processing.
User response:
Ensure the system limit for number of processes or threads has not been
reached (either increase the limit or reduce the number of processes or
threads already running). Ensure that there is sufficient memory for the
new process or thread. Resubmit the utility command
从描述看好像是数据库在申请内存的时候失败,但是内存应该很充裕 ,redhat4.6的时候是16G,升级到redhat5.5
之后已经提高到了64G,应该不会内存不足,但是备份天天做,偶尔失败一次也可以接受,就没在意,之后在值班过程
中发现组内其他系统也会偶尔出现SQL2043N,看来这似乎并不是一个偶尔现象 ,晚上就回家百度一下 SQL2043N,获得
了意外的收获,在官网找到如下解释:
Problem(Abstract)
ASLR or Address Space Layout Randomization is a feature that is activated by default on some of the newer linux distributions. It is designed to load shared memory objects in random addresses. In DB2, multiple processes map a shared memory object at the same address across the processes. It was found that DB2 cannot guarantee the availability of address for the shared memory object when ASLR is turned on. Important note: DB2 10.1 has been enhanced so that ASLR can be safely enabled.
Symptom
This conflict in the address space means that a process trying to attach a shared memory object to a specific address may not be able to do so, resulting in a failure in shmat subroutine. However, on subsequent retry (using a new process) the shared memory attachment may work. The result is a random set of failures. Some processes that have been known to see this error are: db2pd, db2egcf, and db2vend.
Some of the behaviors seen include the following:
For the db2pd command, it will report no data found even through the instance / database is active:
Database SAMPLE not activated on database partition 0. For the db2egcf process, used for HA monitoring, the db2egcf may incorrectly determine the instance is down and initiate a failover. For the db2vend process, backup and log archive methods might fail with an error indicating a child process could not be started:
SQL2043N Unable to start a child process or thread. Diagnosing the problem
When this problem is suspected, check db2diag.log for the shmat failure like the following. Note that the same error message can also occur for a different cause. Hence, it's important to note the process that reported this error. FUNCTION: DB2 UDB, SQO Memory Management, sqlocshr, probe:180
MESSAGE : ZRC=0x850F0005=-2062614523=SQLO_NOSEG
"No Storage Available for allocation"
DIA8305C Memory allocation failure occurred.
CALLED : OS, -, shmat OSERR: EINVAL (22)
Resolving the problem
1) Disable ASLR temporarily (change is only effective until next boot):
Run "sysctl -w kernel.randomize_va_space=0" as root. 2) Disable ASLR immediately and on all subsequent reboots: Add the following line to /etc/sysctl.conf:
kernel.randomize_va_space=0
and then run "sysctl -p" as root to make the change take effect immediately.
大致意思就是LINUX的内存随机化地址特性导致DB2进程不能正确的attach到一个 shared memory object ,那么linux为什么要开启这种特性?
在百度 randomize_va_space 关键字:
Linux Kernel引入了地址空间布局随机化的概念,该概念的提出是出于安全考虑。试想如果堆栈空间的地址都是确定的,那么恶意代码就很容易
通过内存溢出的代码来访问堆栈空间的内容,地址空间布局随机化就是使得进程虚拟空间的布局(主要是各个部分的起始地址)位于随机的位置,
以此来降低被攻击的可能性。
在/proc/sys/kernel/randomize_va_space中的值如果为0则表示关闭所有的随机化,如果为1,表示打开mmap base、栈、VDSO页面随机化,如果
为2则表示在1的基础上进一步打开堆地址随机化。在打开堆地址随机化之前,堆的起始位置是紧接着应用程序bss段之后的。
了解这些之后突然想起在平时使用db2pd时候,也会出现SQL2043N,然后在运行一次就正常了,因为db2pd通过attach db2共享内存来获得数据库
的监控数据,所以db2pd为轻量级工具,对数据库的性能影响比较少
之后在服务器上设置kernel.randomize_va_space=0之后就在无此错误出现
SQL2043N 与 linux的randomize_va_space特性的更多相关文章
- Atitit.linux 内核 新特性 新功能
Atitit.linux 内核 新特性 新功能 1. Linux 3.2内核新特性 2012-02-12 22:41:471 1.1. EXT4:支持更大的块2 1.2. BTRFS:更快的数据清理 ...
- Linux 最新SO_REUSEPORT特性
1.前言 昨天总结了一下Linux下网络编程“惊群”现象,给出Nginx处理惊群的方法,使用互斥锁.为例发挥多核的优势,目前常见的网络编程模型就是多进程或多线程,根据accpet的位置,分为如下场景: ...
- linux的bash特性
Shell本身是应用程序,是用户与操作系统之间完成交互式操作的一个接口程序,为用户提供简化的操作. Bourne Again Shell,简称bash,是Linux系统中默认的shell程序. Bas ...
- XCTF-ics-07(floatval函数特性+Linux目录结构特性)
直接进入到项目管理页面,给了三段源码. 第一段 <?php session_start(); if (!isset($_GET[page])) { show_source(__FILE__); ...
- linux基础02-bash特性
Linux的行结束符是:[$] Windows的行结束符是:[$+回车] 目录管理:ls.cd.pwd.mkdir.rmdir.tree 文件管理:touch.stat.file.rm.cp.mv.n ...
- linux bash基本特性
一.bash 基础特性 (1)命令历史的功能 history: 环境变量 HISTSIZE:命令历史记录的条数 HISTFILE: ~/.bash_history 每个用户都有自己独立的命令历史文件 ...
- linux服务器市场特性高可用高性能 (集群上体现)安全
https://www.linuxprobe.com/chapter-00.html 1 linux安全 更安全 对比windows 代码漏洞 及时修补 全世界看到源代码 2 linux 可以卸载图 ...
- Linux bash基础特性二
shell脚本的组成部分 shebang 各种命令组合 编程变量种类 本地变量: 仅仅在当前的shell生效 环境变量: 在当前和子shell生效 局部变量: shell进程某代码片段 位置变量: $ ...
- Linux bash基础特性一
命令别名 alias cdnet=”cd /etc/sysconfig/network-scripts” 针对用户的别名: “~/.bashrc” 针对系统的别名:”/etc/bashrc” 重读配置 ...
随机推荐
- 基于python网络编程实现支持购物、转账、存取钱、定时计算利息的信用卡系统
一.要求 二.思路 1.购物类buy 接收 信用卡类 的信用卡可用可用余额, 返回消费金额 2.信用卡(ATM)类 接收上次操作后,信用卡可用余额,总欠款,剩余欠款,存款 其中: 1.每种交易类型不单 ...
- poj 1182:食物链(种类并查集,食物链问题)
食物链 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 44168 Accepted: 12878 Description ...
- .NET Nancy 详解(二) 简易路由实现
继续上面的简易版本,有意思的点剩下便是路由实现了. 路由注册 首先,来看一下基本的路由注册过程. public FakeNancyModuleWithoutBasePath() { Delete[&q ...
- Oracle 【IT实验室】数据库备份与恢复之一:exp/imp(导出与导入&装库与卸库)
1.1 基本命令 1. 获取帮助 $ exp help=y $ imp help=y 2. 三种工作方式 (1)交互式方式 $ exp // 然后按提示输入所需要的参数 ...
- 5-06使用Sql 语句为表添加约束
约束名的命名规则推荐采用:约束类型_约束列. 为用户表添加约束 ALTER TABLE UserInfo ADD CONSTRALNT PK_UserId PRIMATY REY(UserId) CO ...
- [WebService] the namespace on the "definitions" element, is not a valid SOAP version
公司对外通过webservice访问别人接口,对方webservice IP地址发生变化,切换过去之后,始终报错,在网上搜索了各种办法之后,暂时总结该问题几种可能解决办法,待真正解决时用的到. 异常详 ...
- Linux SSH远程文件/目录传输命令scp
转载地址:http://www.vpser.net/manage/scp.html 相信各位VPSer在使用VPS时会经常在不同VPS间互相备份数据或者转移数据,大部分情况下VPS上都已经安装了Ngi ...
- 【使用Unity开发Windows Phone上的2D游戏】(1)千里之行始于足下
写在前面的 其实这个名字起得不太欠当,Unity本身是很强大的工具,可以部署到很多个平台,而不仅仅是可以开发Windows Phone上的游戏. 只不过本人是Windows Phone 应用开发出身, ...
- CodeIgniter中驱动器的使用方法
驱动器“Drivers”是CodeIgniter框架从2.0版本开始加入的新特性.正如中文版译者所言: 笔者看了这三篇英文参考,加上自己的一些理解,对官方文档关于驱动器的这一部分进行了一些补充. 1. ...
- 在Salesforce中创建Schedule的Job去定时触发对应的Class
在Salesforce中也存在着Job的概念,当然了我们可以创建Schedule的Job去定时触发对应的Class,来完成我们所需要定时处理的功能,比如:定时同步数据. 具体处理步骤如下所示: 1): ...