The database manager shared memory set cannot be allocated.

Mysteriously my DB2 instance stop starting and dumps:

SQL1220N The database manager shared memory set cannot be allocated.

Don’t ask why this happened but you can increase the amount of shared memory by changing the kernel parameters. You can do that in two ways, by brute force or changing /etc/sysctl.conf:

(1) echo 268435456 > /proc/sys/kernel/shmall

However this will return to the default value at boot time. Therefore you should edit /etc/sysctl.conf, which is loaded at boot time and load it right now:

(2) echo “kernel.shmmax = 268435456″ >> /etc/sysctl.conf && systcl -p

There is no need to reboot in either ways, so if you continue to have problems you probably need expand your memory.

Note the 268435456 value which is 256MB in bytes:

$ echo “268435456/2^20″|bc -l
256


5 Responses to “The database manager shared memory set cannot be allocated.”

  1. Fabio Says:

    Hi! many thanks about your post, I have the same problem with express-c 9.5 on linux (ubuntu 7.10 server) with 2 GB of ram, have you idea if I can use the same values?

    thank you!
    Fabio

  2. METS Standard with IBM DB2 Express C using XForms as user-interface and Ruby on Rails as a Rest Web-services « .$null@dscape/08 Says:

    [...] Solving problem “The database manager shared memory set cannot be allocated” [...]

  3. Vitor Says:

    There is a typo in step 2. It should be “sysctl -p” instead of “systcl -p”. Nice work!

  4. Pradeep Says:

    Its reallay helped me to solve my problem in UBUNTU 8.1 .
    Thanks you very much

  5. Grzegorz Kochan Says:

    Hi, many thanks for this tip.
    Ubuntu 8.10 x64, DB2 9.5

Leave a Reply