Monthly Archives: August 2010

DB2 on Ubuntu: The database manager shared memory set cannot be allocated

I’ve been trying to get DB2 Express-C working on Ubuntu but I get an error when trying to start DB2:

[text]
ashlux@SERVER:~/java/db2exc$ db2
(c) Copyright IBM Corporation 1993,2007
Command Line Processor for DB2 Client 9.7.2

db2 => db2start
SQL1220N The database manager shared memory set cannot be allocated.
[/text]

After some searching I discovered that the problem is probably shmmax being too low. A site on tuning Oracle which shows how to increase shmmax:

[text]
sudo -s "echo 2147483648 > /proc/sys/kernel/shmmax"
[/text]

DB2 successfully starts up now.

Redirect root directory to a subdirectory using .htaccess

Every so often I need to redirect from the root directory http://www.someserver.com to http://www.someserver.com/blah. The first thing I try is always something like:

[text]
# This does not work
RedirectMatch permanent / /blah
[/text]

This ends up not working with Firefox reporting “the page isn’t redirecting properly”. I guess the server gets confused and redirects indefinitely so you must do this instead:

[text]
# Redirect from / to /blah
RedirectMatch permanent ^/$ http://www.someserver.com/blah
[/text]

*cheers*