DB2 自动 stop 可能解决办法

AI权益加码!Claude Code、Cursor等20+工具免费用! 购周边限时加赠Coding Plan Lite,畅享主流AI工具!学习进阶更高效! 阅读详情

ADM0501C  A stack overflow exception has occurred.  The DB2 instance has terminated abnormally.  To remedy this problem, you may increase the default stack size for db2syscs.exe using the db2hdr utility as follows: db2hdr \sqllib\bin\db2syscs.exe /s:<stackreserve>[,<stackcommit>] Note that increasing the default stack size will consume virtual memory space and may reduce the maximum number of concurrent connections.  Contact IBM Support for further assistance.
ADM0501C  发生了堆栈溢出异常。DB2 实例已异常终止。要解决此问题,可以按如下所示使用 db2hdr 实用程序增加 db2syscs.exe 的缺省堆栈大小:db2hdr \sqllib\bin\db2syscs.exe /s:<stackreserve>[,<stackcommit>] 注意,增加缺省堆栈大小将消耗虚拟内存空间并且可能减少并发连接的最大数目          
          
在出现上述错误后,我们的连接程序在操作数据库是总是报:
SQL30081N  检测到通信错误。正在使用的通信协议:"TCP/IP"。正在使用的通信API:"SOCKETS"。检测到错误的位置:"127.0.0.1"。检测到错误的通信函数:"connect"。协议特定的错误代码:"10061"、"*"、"*"。  SQLSTATE=08001
通过在DB2的帮助中心查询后:都是由于配置引起的错误。
  针对错误ADM11003E在网上可以找到相关的信息,但是没有明确的指出解决的办法,但是知道了可以在系统崩溃以后通过杀死db2fmp进程后,DB2数据库可以重新启动。
  我解决问题的方法是进行了下面俩项设置:
          db2 update dbm cfg USING ASLHEAPSZ 20 IMMEDIATE
          db2 update dbm cfg USING query_heap_sz 4000 IMMEDIATE
  后经过跟踪,基本上没有再发生这个问题。

修改方式如下:
  运行DB2命令行工具输入下面命令:
F:\Program Files\ibm\sqllib\misc>db2hdr.exe ..\bin\db2syscs.exe /s:512,512
运行此命令需先停止DB2实例。


附上其他资料:
 When dealing with stack overflow scenarios where the stack size needs to be increased, the executable of the header should only be modified if virtual address space is a concern, i.e. if there are many agents / databases living within an instance. Otherwise, it is sufficient to increase agent_stack_sz to something above 256K, eg. 512K. Note however, that increasing agent_stack_sz actually commits the space, i.e. uses real memory.

The PROBLEM::
-by default a stack space of 256K is reserved for each thread in db2syscs.exe regardless of agent_stack_sz. This information is stored in the header of executable. The Windows default is 1MB, and we override this to conserve virtual address space. AGENT_STACK_SZ is only the committed stack - it does not redivsent the limit.
-If we set agent_stack_sz to 512K, the reserved stack space is actually 1MB (the granularity for reserved stack space when specified on CreateThread is 256K -> 1MB -> 2MB -> 4MB)
-This means that if we only really need 512K, we are wasting 0.5MB of address space per agent, and this can add up - All resources for databases in an instance and ALL threads (agents,divfetchers, etc.) must live within the same 2GB address space on 32-bit Windows (3GB for NT / Win2K Advanced Server / Datacenter with /3GB switch in boot.ini).

There are two ways to increase the stack size. It is not necessary to do both. 
Note the committed stack will be the value of agent_stack_sz regardless, 
i.e. the committed memory will be max(agent_stack_sz, stack actually used).
1. modify the header of the executable (db2hdr will do this) - this is the default reserved stack space per thread. This affects ALL threads.
2. increase agent stack size. This only affects AGENT threads. This is the simplest and is the divferred method.

Disadvantages to (1):
- must be repeated after any upgrades
- increases stack space for *ALL* threads, not just agents, which may be significant if there are a large number of divfetchers & pagecleaners. This increases use of virtual address space.

Advantages to (1):
- more granularity - saves virtual address space by requiring less stack space for agents

Disadvantages to (2):
- wastes virtual address space by reserving excess stack space which may be unacceptable if there are a large number of agents and/or address space is otherwise constrained .

Advantages to (2):
- nothing to ship, supported and documented, change carries through upgrades
- affects only agents, which usually need the extra stack space during statement compilation

SUMMARY: Use agent_stack_sz to increase stack space unless there is a concern with virtual address space.
Examples. (assuming 2GB address space) Monitor Virtual bytes using perfmon. 
1. 10 agents max - increase agent_stack_sz
2. 100 agents, 1 GB current private bytes max for db2syscs.exe - increase agent_stack_sz
3. 100 agents, 1.5GB current private bytes max for db2syscs.exe - modify the header
4. 500 agents, 1GB, current private bytes max for db2syscs.exe - modify the header

IMPORTANT:
when setting agent_stack_sz , set the value to be 1 4K page less than the desired maximum. 
Windows adds an additional "guard page" to the specified size.
i.e. setting a value of 256K will mean 260K, and we jump up to the next level of granularity for reserved stack, eg. 1MB.
Examples:
agent_stack_sz <= 63 to stay within the range of reserving 256K of stack space.
agent_stack_sz <= 255 to stay withini the range of reserving 1MB of stack space
agent_stack_sz <= ( 1 4K page less than the default reserved stack space set with db2hdr )

SIMPLE FIX: set agent_stack_sz to 64, which is the minimum value which will increase the reserved stack to 1MB. 

DB2数据库回滚方法及回滚实例 1、还原数据库db2 restore db dc from /db2_backup/dc taken at 20121102142900 with 1 buffers buffer 2562、回滚数据库,1&gt;和2&gt;只执行其一。1&gt;、作用是将数据库回滚到最新日志时间db2 rollforward db dc to end of logs and stop2&gt;、作用将数据库... 阅读详情

相关推荐

<IBM DB2>《IBM DB2进程清理 for AIX》

全局注册表只存在于 UNIX 和 Linux 平台上: 对于 root 安装,全局注册表文件为 /var/db2/global.reg(HP-UX 上为 /var/opt/db2/global.reg)。与其相关的共享内存段和数据结构段都将在最后一次拆离操作后删除。-S SemaphoreKey 删除由关键字 SemaphoreKey 创建的信号标识和与其相关的信号量集和数据结构。-Q MessageKey 删除由关键字 MessageKey 创建的消息队列标识和与其相关的消息队列和数据结构。

Else 的博客 997

关于DB2启动及停止实例

关于DB2启动和停止实例的相关内容,简简单单

qq_43569111的博客 5922

DB2成功启动后,大约10分钟后自动停止,磁盘空间一直不足

问题描述:DB2成功启动后,大约10分钟后自动停止 解决方案: 1.查看DB2的log tail -f /home/db2inst4/sqllib/db2dump/db2diag.log 2.定位错误 数据库homepage有问题,level:error. 由于homepage有问题,db2尝试修复就会造成大量地吞掉系统磁盘空间。    3.Drop掉homepage

栗子冰激凌 1092

db2常用命令/db2常见报错

一、前言 二、db2服务端常用命令 2.1 启动/停止数据库 2.2 连接数据库 2.3 查看schema下所有表名 2.4 查看表结构 2.5 删除表数据 2.6 导入导出del/ixf文件 2.6.1 del与ixf区别 三、db2客户端常用命令 3.1 查看schema下所有表及每个表的记录数 3.2 修改表字段,对表字段进行新增/修改/删除 3.3 添加注释 3.4 重构表 四、db2常见报错 SQL0668N 不允许对表 "user" 执行操作,原因码为 "7"。 SQLSTATE=57016

weixin_49114503的博客 6304

DB2的License失效引发的问题及解决办法

今天在启动DB2时,遇到了下列情况: db2@linux:/opt/ibm/db2/V9.7/bin> db2start  03/31/2012 10:33:23     0   0   SQL8000N  DB2START processing failed; a valid product license was not found. If you have licensed this p

lyjwin的专栏 1万+

db2stop force

db2执行 db2stop force很长时间无反应时,很可能是:DB2 is hung 可以用db2start 或db2stop执行,可能会返回这样的错误:SQL6036N maybe seen when issuing db2stop or db2start, or the command may hang 解决方法: In some cases, db2 will app

wljwlj的专栏 4670

DB2 解决db2stop 停止不了,数据库仍是活动的

转自: https://blog.csdn.net/qq1099866969/article/details/21549745 1. [odsuser@localhost ~]$  db2stop SQL1025N  The database manager was not stopped because databases are still active 2. [odsuser@loc...

baidu_27082091的博客 1万+

DB2 db2stop force无法停止

1.尝试db2stop force无法停止DB2进程。https://www.cndba.cn/hbhe0316/article/4768 https://www.cndba.cn/hbhe0316/article/4768 https://www.cndba.cn/hbhe0316/article/4768https://www.cndba.cn/hbhe0316/ar...

hbhe0316的专栏 1757

db2stop无法停止

在telnet中执行db2stop时,没有任何反应,执行db2stop force也不成,这时候可以执行db2_kill,再执行ipclean,之后再执行db2stop,应该就可以了。 转载于:https://www.cnblogs.com/seaairland/archive/2010/11/18/1880354.html...

weixin_30492047的博客 671

DB2 HADR Start and stop

HADR就是DB2的高可用容灾特性(Hight Available Disaster Recover),采用数据复制技术持续地从主数据库复制到备份数据库,从而避免数据丢失。 [b]DB2 HADR管理说明 [/b]  [color=red]启动和停止DB2 HADR [/color] 使用START HADR命令启动主数据库和备用数据库的HADR。启动主数据库...

j2ee_zhongqi的专栏 1078

db2 SQL6036N解决办法

问题背景: 数据库在进行大量的运算和数据处理的过程中,IO、CPU等资源消耗非常高的时候,强制停止数据库db2stop force 结果数据库命令迟迟没有响应。这个时候对数据库进行其他操作均无响应,执行启动命令,返回SQL6036N。此时说明数据库已经hung了。 或 调试存储过程,导致数据库hung,想要通过控制中心重启下db2,结果长时间没有任何反应,再想重新连接时报错,如下 SQL6036N START 或 STOP DATABASE MANAGER 命令已在处理之中。 db2stop

Sapphire521的博客 1169

CICS DB2 Attachment Facility

                                    CICS  DB2  Attachment Facility CICS TS for OS/390 comes with an attachment facility that allows you to operate DB2 with CICS. The DB2 system can be shared by se

Mainframer的专栏 742

D_db2_upgrade

转自:http://www.db2china.net/home/space.php?uid=3431&do=blog&id=25313 1.安装DB2 V9.7的介质程序和注册新版本License 不再累述,使用db2_install和db2licm -a完成即可。 2.升级数据库前的检查 升级前的检查是必须的,查看是否会存在升级问题。其实正式进行升级时也进行这步操作,即运行db2ck

g18560的专栏 3037

docker安装db2

这里写自定义目录标题1、查询可安装的db2镜像2、下载db2镜像3、安装镜像功能快捷键合理的创建标题,有助于目录的生成如何改变文本的样式插入链接与图片如何插入一段漂亮的代码片生成一个适合你的列表创建一个表格设定内容居中、居左、居右SmartyPants创建一个自定义列表如何创建一个注脚注释也是必不可少的KaTeX数学公式新的甘特图功能,丰富你的文章UML 图表FLowchart流程图导出与导入导出...

qq_36497518的博客 849

DB2的实例

开始学习DB2 ,从DB2的实例开始吧。 简单地说,DB2的实例是一组进程和一组共享内存,一个实例可以拥有多个数据库,与SQL Server的概念类似。 创建实例:db2icrt InstName        在Windows平台下和Linux/Unix下,DB2实例的差别比较大。Windows系统下,实例不需要与用户绑定,切换实例时(一台Server可拥有多个实例),只需要通过环境变量d

leonlgw的专栏 1376

db2默认启动实例设置

我们想要启动一个实例用db2start,停止一个实例用db2stop 但是如果我们主机有2个或者2个以上的实例,那么使用db2stopdb2start操作的到底是哪一个实例呢?也就是db2的默认实例是如何设置的。 其实windows下db2安装好以后会自动的把相应的环境变量加入到“系统变量”当中,其中 DB2INSTANCE    ---默认实例设置 右键“我的电脑---属性---高级-

猫叔的口粮 5582
上一篇: 又是一个不眠的夜
下一篇: jquery筛选器图
hassen2010
博客等级 码龄18年 92粉丝 164原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值