DBA Corner

Data is stored somewhere

Oracle IPC Resources: Map Shared Memory to an Instance

On UNIX and Linux hosts with several Oracle instances, ipcs can show many shared-memory and semaphore resources without identifying the owning database clearly. Oracle’s sysresv utility maps System V IPC resources to an Oracle SID.

Report resources for an instance

export ORACLE_SID=PROD
export ORACLE_HOME=/path/to/oracle/home

$ORACLE_HOME/bin/sysresv

To check one or more explicitly named instances:

$ORACLE_HOME/bin/sysresv -l PROD TEST

Run the command as the Oracle software owner with the correct Oracle home. Compare its output with ipcs -m for shared memory and ipcs -s for semaphores.

Use ORADEBUG for a running instance

SQL> CONNECT / AS SYSDBA
SQL> ORADEBUG SETMYPID
SQL> ORADEBUG IPC
SQL> ORADEBUG TRACEFILE_NAME

The generated trace records IPC information for the connected instance. This is useful for comparison, but sysresv is the purpose-built operating-system utility.

Removing orphaned resources safely

  1. Confirm the instance is down and that no PMON process exists for the SID.
  2. Verify the SID, Oracle home, owner, and resource identifiers twice.
  3. Prefer the interactive form sysresv -i -l SID.
  4. Never use ipcrm or sysresv -f against a running or uncertain instance. Removing live SGA resources can crash or corrupt service.

Reference

Oracle documents the syntax and safeguards in its Linux and UNIX administrator’s reference.


Comments

Leave a Reply

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