When you try to start the saposcol the error message “could not attach shared memory” occurs: You have to clean manually the shared memory. This can happen with sapccmsr too.

Keys of share memory:
saposcol - 4dbe
sapccmsr - 4dc4

As we have problem with saposcol, use will look for the key of share memory 4dbe.

# ipcs -m | grep 4dbe
m XXXX 0x00004dbe --rw-rw-re- root .......................

After the m, you will have the number of the shared memory (XXXX). To to delete the shared memory you can use the following os command: (As user root)

# ipcrm -m XXXX

This will resolve your problem.