Home » Oracle » Oracle Database » how to find the semaphore for the Database instance

how to find the semaphore for the Database instance

how to find the semaphore for the Database instance

When Oracle Instance is not running

/u01/app/oracle/product> sysresv
 IPC Resources for ORACLE_SID “TEST″ :
 Shared Memory
 ID KEY
 No shared memory segments used
 Semaphores:
 ID KEY
 No semaphore resources used
 Oracle Instance not alive for sid “TEST″

When Oracle Instance is running

/u01/app/oracle/product> sysresv
 IPC Resources for ORACLE_SID “TEST″ :
 Shared Memory:
 ID KEY
 14437 0xe4efa8324dc
 Semaphores:
 ID KEY
 1232330802 0x09d48331246
 Oracle Instance alive for sid “TEST″

Removing IPC resources

Suppose you try to start the instance and it complains about its running due to orphan semaphore and sysresv also determine the instance is not active. Then the following command could be used to remove the shared memory and semaphores

/u01/app/oracle/product> sysresv -i
 IPC Resources for ORACLE_SID "TEST" :
    Shared Memory:
    ID              KEY
    16837           0xe4efa8dc
    Semaphores:
    ID              KEY
    12714018        0x09d48346
    Oracle Instance not alive for sid "TEST" 
 Remove ipc resources for sid “TEST″ (y/n)?y
 Done removing ipc resources for sid “TEST″

Verify the resources were removed

/u01/app/oracle/product> sysresv
 IPC Resources for ORACLE_SID “TEST″ :
 Shared Memory
 ID KEY
 No shared memory segments used
 Semaphores:
 ID KEY
 No semaphore resources used
 Oracle Instance not alive for sid “TEST″

If you need to remove memory segments, and Oracle detects the instance is alive through sysresv

% ipcrm -m <mem-id>
 Where is the memory id shown in the sysresv output.
 Example:    
% ipcrm -m 12333 

If you need to remove semaphores, and Oracle detects the instance is alive through sysresv

% ipcrm -s  <sem-id>
 where is the semaphore id shown in the sysresv output.

Related Articles
Step by Step Oracle 12c Database Installation on Linux
Flashback PDB in Oracle Database 12c Release 2
How to perform Database cloning
Oracle Database Recovery various cases and solution

See also  Oracle Database 19c new features

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top