Skip to Content

The cleanipc command is used to clear the shared memeory occupied by the SAP system. Mostly, this command is used (by <sid>adm user) while restarting an SAP system. So, you stop the system using stopsap, run the cleanipc command to clear the memory and then start the system using startsap.

Command: cleanipc <instance_nr> remove

However, sometimes, cleanipc fails to cleanup some semaphores saying: Semaphore Key: XX remove failed **** – errno = 1 (Not owner)

Command: cleanipc 06 remove

/wp-content/uploads/2012/05/1_99159.jpg

In this case, login as root and run the following commands:

ipcs –s | grep “the number from the semaphore”

ipcrm –s “the number from the above command”

/wp-content/uploads/2012/05/2_99160.jpg

The above command ipcrm clears up the semaphore which was not cleared by cleanipc command when executed by <sid>adm user. Now, if you run cleanipc again using <sid>adm, you will find that the affected semaphore is now cleared.

/wp-content/uploads/2012/05/3_99176.jpg

To report this post you need to login first.

2 Comments

You must be Logged on to comment or reply to a post.

  1. J. Engelen

    running ‘slibclean’ as ‘root’ usually also helps. this command cleans all *unused* libraries from memory. As root-privs are sometimes not given to SAP-admins, the command is usually provided through sudo.

    (0) 
  2. Wilson Hernan Salazar Herrera

    Hello Shitij

    I needed change AIX user ID for <sid>ADM in Bank Analyzer system and don’t execute cleanipc before this. When i execute cleanip all smaphore and Shared Memory report “Not Owner” error; I cleaned memory with same commands but with -m option:

    ipcs –ma | grep “The number from the shared Memory Key ”

    ipcrm –m “the ID number from the above command”

    Following I used your commands… and cleanipc show correct response and all service start correctly

    Thank you!!!!

    (0) 

Leave a Reply