Skip to Content

Some time it will be useful to know the which SAP work process is having which corresponding Oracle shadow work process and Check them out at OS level.

Lets briefly discuss The OPS$ Mechanism under UNIX

For the Oracle database, the SAP System is a single user, SAPSR3 or <SAP Schema User> (whatever name given to schema User). Its password is stored in the table SAPUSER. Therefore, to access the database, the SAP System uses a mechanism called the OPS$ mechanism, the ops$<user> in Oracle is a database user identified ‘externally’. This means that the database does not have a password for the user but allows them to login directly from a shell prompt with ‘sqlplus /’. Security is limited to the UNIX login and password. The string ‘OPS$’ is configurable in the Oracle init file, OPS$ being the default.

Let’s consider the SAP work process connection to Oracle database:

  1. The work process initiates connection using operating system (OS) authentication via its corresponding OPS$ User.  It first logs on to the database as the user OPS$<operating_system_user>, for example, OPS$<SAPSID>adm.
  2. On successful connection, the work process checks the SAPUSER table for the password of <SAP Schema User>. The password of <SAP Schema User> is stored in default oracle password table as well as SAPUSER table. Basically one should not edit the password of this user using Oracle methods or tools. The recommended method is via SAP’s BRCONNCET tool. Because when you change the <SAP Schema User> password via Oracle, the password will not be changed in the SAPUSER table which is the reference repository for the user’s password when the connection process is initiated.
  3. After retrieving the password from the SAPUSER table, the work process disconnects from Oracle.
  4. The work process then connects with the username <SAP Schema User> using the password retrieved from the SAPUSER table. Now this <SAP Schema User> has exhaustive authorization on DB.

OK, lets proceed for Oracle shadow process identification:

Oracle clients are programs using the oracle database, they will not directly access the database files. They will initiate their database connection connecting to the ORACLE-Listener using TCP/IP communication. The listener will assign a so called Shadow process which then will connect to the Oracle Client program. Every database access of the Oracle Client is done through the shadow process.

There are alternative communication methods (shared memory, pipe), SAP default is TCP/IP.

There are alternative server configurations

  • Shared server – several Oracle Clients will share one Oracle shadow process
  • Dedicated server – each Oracle Client has it’s own shadow process

SAP default is dedicated server.

On Windows we have a little different architecture: The shadow process is implemented in form of a shadow thread in the Oracle Service process.

In terms of SAP standard configuration, each work process, r3trans, tp, br*.exe have their own shadow process / thread.

Shadow processes are client processes managed by the Oracle database. They exist not just for SAP dialog work processes but for all work processes running on all application servers.

To view shadow process information from SAP, use ST04 & SM50.

ST04 -> Performance -> Additional Functions -> Display GV$-Views -> GV$SESSION

There you can find all oracle shadow process.

Watch out for field names like “Schema User name”, “OS UID”, “OS Process ID”, “servername”,  “Operating system program name” & “Client ID”

  • Field “OS Process ID” can be mapped against SM50 screen “PID” these can be view at OS level as well by the corresponding processes ID.
  • Field “Client ID” will tell the SAP User ID, if particular work process is catering SAP work process.

Now if you want to relate SAP work process and corresponding oracle shadow process goto

ST04 -> Performance -> Wait Event Analysis -> Session Monitor

Field “Op. sys. PID” tells the oracle shadow process ID at OS level

Field “SID” from this screen can be mapped with field “Session ID” of GV$SESSION screen previously discussed.

In this way oracle shadow process and corresponding SAP work process can be mapped with help of these two separate screens of ST04 and SM50.

Hope this will be of help to some of us.

LineSeparator.jpg

My other Blogs, if you have time…

Bye bye STRUSTSSO2: New Central Certificate Administration NW7.3

How to Rename the Oracle Listener & Change Listener port for SAP

Multiple/Bulk transports with tp script for Unix (AIX, Solaris, HP-UX, Linux)

OSS1 & RFC connections SAPOSS, SAPNET_RFC, SDCC_OSS

Interrelation: SAP work process, OPS$ mechanism, oracle client & oracle shadow process

Install and configure NetWeaver PI 7.3 Decentralize Adapter part-1

Install and configure NetWeaver PI 7.3 Decentralize Adapter part-2

To report this post you need to login first.

4 Comments

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

  1. Kate Ji

    Hello Ahmad,

    I would like to ask a question.

    you mentioned OS ID in GV$session can be mapped to SM50 PID

    but since one WP can have many oracle session , that lead to the problem that i’ve few change to map one OS ID in question to the WPID.

    Is there some way that can help me found with WP related to the specific OS ID in question?

    Thank you!

    Kate JI

    (0) 
    1. Ishteyaque Ahmad Post author

      Hi Kate,

      Below is the part of output of SM50 screen and from OS level ps -ef. I took the sm50 PID and looked for the process ID at OS level.

      —————————————————————————————

      |  No.|Ty.|PID  |Status |Reasn|Start|Err|Sem|CPU|Time|Report  |Cl.|User  |Action|Table|

      —————————————————————————————

      |   0 |DIA|31957|Waiting|     |Yes  |21 |   |   |    |        |   |      |      |     |

      |   1 |DIA|3040 |Waiting|     |Yes  |16 |   |   |    |        |   |      |      |     |

      |   2 |DIA|27979|Waiting|     |Yes  |18 |   |   |    |        |   |      |      |     |

      |   3 |DIA|9210 |Waiting|     |Yes  |16 |   |   |    |        |   |      |      |     |

      |   4 |DIA|13917|Waiting|     |Yes  |4  |   |   |    |        |   |      |      |     |

      |   5 |DIA|31964|Waiting|     |Yes  |21 |   |   |    |        |   |      |      |     |

      |   6 |DIA|17820|Waiting|     |Yes  |19 |   |   |    |        |   |      |      |     |

      |   7 |DIA|17825|Running|     |Yes  |3  |   |   |    |SAPLTHFB|210|AHMADI|      |     |

      |   8 |DIA|27983|Waiting|     |Yes  |4  |   |   |    |        |   |      |      |     |

      |   9 |DIA|27984|Waiting|     |Yes  |19 |   |   |    |        |   |      |      |     |

      ahsadm   16535 24327  0 00:17 ?    00:00:01 dw.sapAHS_DVEBMGS20 pf=/usr/sap/AHS/SYS/profile/AHS_DVEBMGS20_arlh2kad03
      ahsadm   17662 24327  0 Feb06 ?    00:00:11 dw.sapAHS_DVEBMGS20 pf=/usr/sap/AHS/SYS/profile/AHS_DVEBMGS20_arlh2kad03
      ahsadm   17820 24327  0 01:18 ?    00:00:01 dw.sapAHS_DVEBMGS20 pf=/usr/sap/AHS/SYS/profile/AHS_DVEBMGS20_arlh2kad03
      ahsadm   17825 24327  0 01:18 ?    00:02:03 dw.sapAHS_DVEBMGS20 pf=/usr/sap/AHS/SYS/profile/AHS_DVEBMGS20_arlh2kad03
      ahsadm   21139 24327  0 Feb06 ?    00:00:02 dw.sapAHS_DVEBMGS20 pf=/usr/sap/AHS/SYS/profile/AHS_DVEBMGS20_arlh2kad03
      ahsadm   21169 24327  0 Feb06 ?    00:00:02 dw.sapAHS_DVEBMGS20 pf=/usr/sap/AHS/SYS/profile/AHS_DVEBMGS20_arlh2kad03
      ahsadm   21906 24327  0 04:37 ?    00:00:38 dw.sapAHS_DVEBMGS20 pf=/usr/sap/AHS/SYS/profile/AHS_DVEBMGS20_arlh2kad03
      (0) 
      1. Kate Ji

        Hi Ahmad,

        Thank you very much for your reply.

        It’s clear.

        Because My Daily is during with the database.

        So the most case is to map the WP in SM50 to the ST04 oracle session.

        I drew a picture here, pls refer to the attachment.

        https://docs.google.com/file/d/0B3NSerpEParLajRNUWVjN0otMTg/edit?usp=sharing

        {Could you help me to check this picture? }

        Since SAP WP : Oracle Session = 1:N

        So it will always to the prb that one specific WP(with PID) can’t found its corresponding sessions(they are also with PID), isn’t it?

        Thank you very much!

        Have a nice day!

        Kate

        (0) 

Leave a Reply