oninit -vy 出錯: Fatal error in shared memory creation 以及 shared memory already exists

liahtobjtosh發表於2010-02-28
oninit -vy 出錯: Fatal error in shared memory creation 以及 shared memory already exists[@more@]

使用 onmode -ky 關閉 informix 後,再重啟,不成功:
[19] % oninit -vy
Checking group membership to determine server run mode...succeeded
Reading configuration file '/informix/ids2/etc/onconfig.wnms'...succeeded
Creating /INFORMIXTMP/.infxdirs...succeeded
Checking config parameters...succeeded
Allocating and attaching to shared memory...FAILED
oninit: Fatal error in shared memory creation

WARNING: server initialization failed, or possibly timed out (if -w was used).
Check the message log, online.log, for errors.
[20] % onstat -m

IBM Informix Dynamic Server Version 11.50.FC6WE -- On-Line -- Up 1 days 19:22:33 -- 1267556 Kbytes

Message Log File: /informix/ids2/online.log

16:50:13 Checkpoint Completed: duration was 0 seconds.
16:50:13 Sun Feb 28 - loguniq 5, logpos 0x3f8e018, timestamp: 0x6f759 Interval: 348

16:50:13 Maximum server connections 1
16:50:13 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0, Plog used 2, Llog used 2

17:05:22 Checkpoint Completed: duration was 0 seconds.
17:05:22 Sun Feb 28 - loguniq 5, logpos 0x3f90018, timestamp: 0x6f769 Interval: 349

17:05:22 Maximum server connections 1
17:05:22 Checkpoint Statistics - Avg. Txn Block Time 0.000, # Txns blocked 0, Plog used 2, Llog used 2

17:07:49 IBM Informix Dynamic Server Started.
17:07:49 Warning: The IBM IDS Workgroup Edition license restriction limits
17:07:49 the total shared memory size for this server to 16777216 KB.
17:07:49 The size has been reset to the limit to bring up the database server.
17:07:49 shmget: [EEXIST][17]: key 52584801: shared memory already exists
17:07:49 mt_shm_init: can't create resident segment

從 得知:
onmode -ky 後 informix 仍佔有共享記憶體

一、解決過程如 http://bbsanwei.javaeye.com/blog/370745 所述

wx-dev% ipcs -m |grep -v grep |grep informixm 16385 0x52594801 --rw-rw---- root informix
m 16386 0x52594802 --rw-rw---- root informix
m 16387 0x52594803 --rw-rw---- root informix
m 16388 0x52594804 --rw-rw---- root informix
m 16389 0x52594805 --rw-rw---- root informix
m 21512 0x52594806 --rw-rw---- root informix
m 7181 0x52594807 --rw-rw---- root informix
m 7182 0x52594808 --rw-rw---- root informix
m 7183 0x52594809 --rw-rw-rw- root informix

wx-dev% ipcrm -m 16385 16386 16387 16388 16389 21512 7181 7182 7183

二、
在文章: 中提到:在 IDS 11.5 xC4 後提供了 onclean 命令來清除共享記憶體。
(The onclean utility attempts to clean up shared memory, semaphores, and stops database server virtual processes. )
以及使用 onshutdown.sh(unix) 或 onshutdown.bat(windows) 來停止 informix 服務。
(The onshutdown script first runs the onmode -ky command, and then after a specified wait time, runs the onclean -ky command.)
但是,我使用 onclean 不能清除共享記憶體。

三、
我以前看過一篇文章,上面曾經給出用配置引數 SERVERNUM 計算共享記憶體地址的方法,但現在找不到那篇文章了。所以我認為透過修改配置引數 SERVERNUM 也應該可以重啟informix 的。(試驗沒成功,估計是記憶體重疊的原因)

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22565551/viewspace-1031513/,如需轉載,請註明出處,否則將追究法律責任。

相關文章