The database manager failed to allocate shared memory because an operating system kernel memory limit has been reached
I just had the same problem! In my case the problem was just the memory of the DB2 instance.

In windows type:

db2 get dbm cfg | findstr MEMORY


In linux:

db2 get dbm cfg | grep MEMORY


You will get something like that:

Global instance memory (4KB)          (INSTANCE_MEMORY) = 500000


The solution in my case was simply set the same threshold value but by activating the automatic mode:

db2 update dbm cfg using INSTANCE_MEMORY 100000 automatic immediate


The command "immediate" apply the settings now without the need to restart the instance. So if you get the settings again will have:

Global instance memory (4KB)          (INSTANCE_MEMORY) = AUTOMATIC(5000000)


Now try to connect to your database again. I believe that will again connect normally.

According to the DB2 documentation:


  This parameter specifies the maximum amount of memory that can be
  allocated for a database partition if you are using DB2® database
  products with memory usage restrictions or if you set it to a specific
  value. Otherwise, the AUTOMATIC setting allows instance memory to
  grow as needed.


Font: IBM Knowledge Center