Tuesday, January 24, 2012

How to map semaphores id and cleanup in unix to Oracle process

How to map semaphores id in unix to Oracle process:


eg: ps -ef | grep pmon | grep -v grep

oracle   23398     1  0  2011 ?        00:06:05 ora_pmon_DB1
oracle   24488     1  0 Jan10 ?        00:01:51 ora_pmon_DB2
oracle   31682     1  0 Jan23 ?        00:00:23 ora_pmon_DB3


ipcs -map

------ Shared Memory Creator/Last-op --------
shmid      owner      cpid       lpid    

80642052   oracle     31653      32595  
79790085   oracle     23371      29972     - marked  in trace file
80510982   oracle     24226      30222  

Now each shmid is mapped with each database. now we need to find out which shmid belongs to which database

1. Login to DB1
2. sqlplus ' /as sysdba'

        SQL> oradebug setmypid
        Statement processed.
        SQL> oradebug ipc
        Information written to trace file.

3. got to dump file location and open lastly generated trace file

Dump file /oracle/admin/DB1/udump/db1_ora_15433.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bit Production
With the Partitioning, Real Application Clusters, Oracle Label Security, OLAP,
Data Mining Scoring Engine and Real Application Testing options
ORACLE_HOME = /oracle/product/10.2.0.5/DB1
System name:    Linux
Node name:      db1-linux
Release:        2.6.18-238.9.1.el5
Version:        #1 SMP Fri Mar 18 12:42:39 EDT 2011
Machine:        x86_64
Instance name: DB1
Redo thread mounted by this instance: 1
Oracle process number: 33
Unix process pid: 15433, image: oracle@db1-linux (TNS V1-V3)

*** 2012-01-24 12:51:31.038
*** ACTION NAME:() 2012-01-24 12:51:31.038
*** MODULE NAME:(sqlplus@ldb1-linux (TNS V1-V3)) 2012-01-24 12:51:31.038
*** SERVICE NAME:(SYS$USERS) 2012-01-24 12:51:31.038
*** SESSION ID:(2769.41080) 2012-01-24 12:51:31.038
Dump of unix-generic skgm context
areaflags            000000e7
realmflags           0000000f
mapsize              00000800
protectsize          00001000
lcmsize              00001000
seglen               00200000
largestsize  0000001f7d2fb800
smallestsize 0000000001000000
stacklimit     0x7fffd5de24c0
stackdir                   -1
mode                      640
magic                acc01ade
Handle:            0x1965f470 `/oracle/product/10.2.0.5/DB1'
Dump of unix-generic realm handle `/oracle/product/10.2.0.5/DB1', flags = 00000000
 Area #0 `Fixed Size' containing Subareas 0-0
  Total size 0000000000209ab8 Minimum Subarea size 00000000
   Area  Subarea    Shmid      Stable Addr      Actual Addr
      0        0         79790085 0x00000060000000 0x00000060000000
                              Subarea size     Segment size
                          000000000020a000 0000000540200000
 Area #1 `Variable Size' containing Subareas 2-2

4. You can map this id to id you got in above output in ipcs 

Cleanup the process using ipcrm command:


ipcrm -m 79790085 












No comments:

Enabling SSL or TLS in Oracle E-Business Suite Release 12.2

Enabling TLS in Oracle Apps R12.2 Here  we would be looking at the detailed steps for Enabling TLS in Oracle Apps R12.2 Introduction: ...