UnixPedia : HPUX / LINUX / SOLARIS: HPUX : How to remove or release share memory and Semaphore

Tuesday, January 22, 2013

HPUX : How to remove or release share memory and Semaphore

Database got hung , and it is believe that it was not cleanly down. Which left some shared memory and semaphore on the server.
While database start up , it complain of share memory.

To check the shared Memory and semaphore :

% ipcs -a
% ipcs -mab

#-> ipcs -ma|grep -i Kondba
m  177307655 0x00000000 --rw-rw----    Kondba    condba    Kondba    condba     21 1462915072 28073 21739  9:49:24  9:51:06  4:31:53
m    1769491 0x00000000 --rw-rw----    Kondba    condba    Kondba    condba     21 1476395008 28073 21739  9:49:24  9:51:06  4:31:53
m     229397 0x00000000 --rw-rw----    Kondba    condba    Kondba    condba     21 1194823680 28073 21739  9:49:24  9:51:06  4:31:53
m     196630 0x1c9e12b0 --rw-rw----    Kondba    condba    Kondba    condba     21      12288 28073 21739  9:49:24  9:51:06  4:31:53
m      32793 0x00000000 --rw-rw----    Kondba    condba    Kondba    condba      0  507408384 22350 27863  5:41:15  5:41:15  0:44:12
m      32794 0x3d6313d4 --rw-rw----    Kondba    condba    Kondba    condba      0      12288 22350 22298  9:52:23  9:52:23  0:44:12
m   11304987 0x90321bdc --rw-r-----    Kondba    condba    Kondba    condba     13 1075056640 29768 21978  9:50:04  9:51:12  1:04:19
m     327708 0xdc600560 --rw-r-----    Kondba    condba    Kondba    condba     16 1074008064   305 21291  9:48:09  9:48:09  1:05:20
m     229405 0x3aec7cb8 --rw-r-----    Kondba    condba    Kondba    condba     15  897847296   475 21315  9:48:24  9:48:24  1:06:02

Below process have NATTACH value is equal to 0

32793 0x00000000 --rw-rw----    Kondba    condba    Kondba    condba      0
 32794 0x3d6313d4 --rw-rw----    Kondba    condba    Kondba    condba      0
One line command to check the NATTACH :
#ipcs -mob |awk '$1=="m" && $7==0 {print $0}'
The command syntax to remove the shared memory segments or semaphores is as follows:
   %  ipcrm -m <shared memory id>
   %  ipcrm -s <semaphore id>
  %   ipcrm  -m 32793
  %  ipcrm   -m 32794

After cleaning the shared memory , DB will be started successfully.


1 comment:

  1. mind blowing
    information
    Your Informative article is not coming in now a days why sir, please share your thougt and tric on UNIX and LINUX

    ReplyDelete