Checking internal concurrent manager status

How to check which process belongs to which database by comparing the parent process with the Internal Manager process.

In most organizations, it is common practice for an Oracle Apps DBA to check the Unix Process of the Internal Concurrent Manager using this command:

ps ?ef | grep CPMGR 

or 

ps ?ef | grep FNDCPMBR 

applmgr 24988 24984  0   Dec 26 ?        5:16 FNDLIBR FND CPMGR FNDCPMBR sysmgr=""  sleep=30 logfile=/Ora_base/thor/rpt/co

applmgr 20050 20040  0   Dec 16 ?        3:30 FNDLIBR FND CPMGR FNDCPMBR sysmgr=""  sleep=30    logfile=/Ora_base/thor/rpt/co

applmgr 19900 19889  0   Dec 16 ?        4:53 FNDLIBR FND CPMGR FNDCPMBR sysmgr=""  sleep=30    logfile=/Ora_base/thor/rpt/co

applmgr 22629 22624  0   Dec 16 ?        0:56 FNDLIBR FND CPMGR FNDCPMBR sysmgr=""  sleep=30    logfile=/Ora_base/thor/applmg

applmgr 24757 24753  0   Dec 26 ?        5:04 FNDLIBR FND CPMGR FNDCPMBR sysmgr=""  sleep=30    logfile=/Ora_base/thor/rpt/co

However, either way the result will be the same because the search string exists in the output. If you have a single instance, then you would get just one output and that would indicate that the Internal Concurrent Manager Process is up (but not necessarily running or active). In case you have different releases of Oracle Apps on the same server and if the output of the command above is as shown, then it would be difficult to find out which background process belongs to which application.

If you are not on server Partition mode, then you could use the old way of checking the SPID and comparing with the PPID. In the 10.7 NCA without Server Partition Mode release, the Oracle Home was common for both the database and the Application, so the Internal Concurrent Manager background process was always spawned by a parent process that had an ORACLE_SID attached to it. You could easily check which process belongs to which database by comparing the parent process with the Internal Manager process. For example:

ps -ef | grep -v grep | grep FNDCPMBR | awk  '{print $2}' | while read CMPID 
            do 
                ps -ef | nawk -v CMPPID=$CMPID '{if (CMPPID == $3) {print $0} }' | grep oracle 
$ORACLE_SID >/dev/null 
                if [ $? == 0 ] ; then 
                  echo "Conc Mgr for database=$ORACLE_SID is UP" 

Here we check the background process only and presume that the Internal Manager is up and running and in case its Active process gets set to zero due to errors, it doesn't raise a flag -- only the users and developers would call up to say that all the requests are clogging. With de-support of 7.x, most organizations have moved quickly to 8i using the server partition option and the old script above needs modification.

 
#!/bin/ksh 
#=========================================================================== 
# Filename: icmtest 
# Author  : Shankar Govindan. 
# Created : 12/25/2001 
# Good for : Release 10.7 NCA Server Partition Mode only 
# Description : This script is used for checking out the status of 
# Internal Manager in Oracle APPS, 
# It picks up the OS_PROCESS_ID from FND_CONCURRENT_PROCESSES, spools 
# them and then looks for the actual OS process with its corresponding
# ORACLE_SID. 
# The grep looks for SPID and LOCAL = NO because of Server 
# Partition mode and Oracle version 7x. 
# Note :  I have used a password file with system/manager, instead of 
# passing it directly. 
# 
#               1st Argument: status 
#               2nd Argument: ORACLE_SID (optional) 
# 
#=========================================================================== 

if ( [ "$1" != "status" ] ) 
  then 
        echo "Usage: $0 status " 
        echo " Eg.: $0 status OSID" 
  exit 
fi 

CMD=$1 
OSID=$2 
ORACLE_SID=`echo $ORACLE_SID` 
TEMPDIR=`pwd` 
GROUP=`groups | cut -d" " -f1` 

function _icmtestcmd 
{ 
  echo "=========================================================================" 
  echo "checking Internal concurrent Manager status for Database ${ORACLE_SID}" 
  date 
  echo "=========================================================================" 
 echo 
 PWD_FILE=/dba/etc/.${GROUP}_${ORACLE_SID}.pwd 
 SYSTEM_PWD=`grep -i "^system/" $PWD_FILE` 
 case $CMD in 
  status) 
         if [ "$SYSTEM_PWD" = "" ] ; then 
               echo "nERROR: userid=system does not exist in ${PWD_FILE}" 
               return 1 
         fi 
#         echo "** Sending status for Oracle database=${ORACLE_SID}" 
         (echo ${SYSTEM_PWD}; 
          echo set pages 0 pause off verify off feedback off termout off;
          echo "select p .spid from v$process p, v$session s, 
                apps.fnd_concurrent_processes f, apps.fnd_concurrent_queues q
                where p.addr = s.paddr and s.sid = f.oracle_process_id and
                f.concurrent_queue_id = q.concurrent_q ueue_id and
                q.concurrent_queue_name = 'Internal Manager and 
                q.running_processes = 1 group by p.spi d order by 1 ;")|
                sqlplus -s > $TEMPDIR/icmppid 
        ps -ef | grep -i `cat $TEMPDIR/icmppid` |grep NO | while read LINE 
do 
        MATCH=`echo $LINE | awk  '{print $9}'` 
        if [ "$MATCH" = "oracle${ORACLE_SID}" ] ; then 
            echo "For Database=$ORACLE_SID , Internal Concurrent Manager is 
                  UP and RUNNING !!" 
            echo 
               return 1 
            echo 
               else 
            echo "Database=$ORACLE_SID Internal Cocnurrent Manager is DOWN" 
            echo 
        fi 
done 
       return 0 
  ;; 
*) echo "nERROR: Invalid option=$CMD (in function _icmtestcmd)" 
            return 2 
            ;; 
  esac 
} 
# 
#MAIN 
# 
if [ "$CMD" = "status" ]; 
   then 
          _icmtestcmd $CMD $OSID 
   else 
   echo " Database is down " 
      wait 
   return 1        
fi 

The above scripts were tested on Sun Solaris 2.6 and Oracle Apps 10.7 NCA and Release 11. Note: This info is my individual opinion and has nothing to do with the company I work for or represent.

About the Author

Shankar Govindan works as a Senior Oracle DBA at CNF in Portland, Oregon. He is Oracle Certified for versions 7, 8 and 8i. You can contact him at shankargovindan@yahoo.com.

For More Information

  • What do you think about this tip? E-mail the Editor at tdichiara@techtarget.com with your feedback.
  • The Best Oracle Web Links: tips, tutorials, scripts, and more.
  • Have an Oracle tip to offer your fellow DBA's and developers? The best tips submitted will receive a cool prize--submit your tip today!
  • Ask your technical Oracle questions--or help out your peers by answering them--in our live discussion forums.
  • Check out our Ask the Experts feature: Our SQL, database design, Oracle, SQL Server, DB2, metadata, and data warehousing gurus are waiting to answer your toughest questions.

This was first published in February 2002

Dig deeper on Oracle database design and architecture

Pro+

Features

Enjoy the benefits of Pro+ membership, learn more and join.

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchDataManagement

SearchBusinessAnalytics

SearchSAP

SearchSQLServer

TheServerSide

SearchDataCenter

SearchContentManagement

SearchFinancialApplications

Close