Showing posts with label Concurrent Managers. Show all posts
Showing posts with label Concurrent Managers. Show all posts

Tuesday, November 27, 2018


What are Concurrent Managers


Concurrent processing is one of the key elements of any E-Business Suite system

  • Concurrent Managers are the controllers of background processing for Oracle Applications.
  • The main function of Concurrent Managers is to regulate, and control process requests based upon a set of rules.
  • It is a technique used to execute noninteractive, data-dependent programs simultaneously in the background.
  • Oracle Applications comes with predefined managers, including the Internal Concurrent Manager (ICM), Standard Manager, Conflict Resolution Manager (CRM) and Transaction Managers (TM).
  • The Internal Concurrent Manager controls all the other Concurrent Managers that are operating system processes that poll for requests.
  • Within Applications, you can also create any number of Concurrent Managers to handle particular types of requests or programs and specialize them for your business requirement
  • The ICM (Internal Concurrent Manager) controls all of the other concurrent managers.
  • The Standard Manager accepts any and all requests. It has no predefined specialization rules and is active all the time. It is not recommended to add specialization rules to the standard manager as it is common to cause problems.
  • The Conflict Resolution Manager resolves conflicts, such as request incompatibilities.

It provides scheduling and queuing functionality for background jobs, and it’s used by most of the application modules. As many things depend on concurrent processing, it’s important to make sure that the configuration is tuned for your requirements and hardware specification.


how does a concurrent manager process work? Here is a diagram I created to explain it:

Reference - 


Concurrent manager reference (pythianblog.wpengine.com)


Internal workflow of a concurrent manager process

Internal workflow of a concurrent manager process

Diagram to provide more details about them:
1. This is where the story begins. There is no EXIT state in the diagram as the managers normally process requests in an infinite loop. Obviously, there is a way for a concurrent manager process to receive the command to quit when the managers need to be shut down, but that’s not included here for simplicity.
2. Internal Concurrent Manager (ICM) requests the Service Manager (FNDSM) to start up the Concurrent Manager process. For the Standard Manager processes, the binary executable FNDLIBR is started. For the Inventory Manager, it’s  INVLIBR. There are others too.
3. The manager process connects to the database and reads the settings (e.g profile options, sleep seconds, cache size).
4. The process saves information about itself in FND_CONCURRENT_PROCESSES table (os process id, database name, instance name, DB session identifiers, logfile path and name, and others). It also updates FND_CONCURRENT_QUEUES by increasing the value of RUNNING_PROCESSES.
5. The concurrent manager process collects information from the database to build the SQL for querying the FND_CONCURRENT_REQUESTS table. The query will be used every time the manager process looks for scheduled concurrent requests.  This is the only time the manager process reads the Specialization Rules (which programs it is allowed to execute) from the database. Keep in mind that if the specialization rules are changed while the managers are running, they are bounced without warning as that is the only way to update the specialization rules cached by the manager process.
6. The SQL (from step 4) is executed to collect information about pending concurrent requests from FND_CONCURRENT_REQUESTS table.
7. The results are checked to verify if any requests are pending for execution.
8. If no requests are pending for execution, the manager process sleeps and then goes to step 5. The “Sleep Seconds” parameter of the  “Work Shifts” settings of the concurrent manager determines how long the process sleeps before FND_CONCURRENT_REQUESTS table is queried again. This is the only time the “sleep seconds” setting is used.
9. If there is at least one concurrent request pending for execution, the concurrent manager process caches rowids for the FND_CONCURRENT_REQUESTS rows of pending concurrent requests. The “Cache Size” setting of the concurrent manager specifies how many rowids to cache.
10.    The cached list of rowids is checked to verify if there are any unprocessed concurrent requests (rows in FND_CONCURRENT_REQUESTS table) left. If none are left – the processing returns to step 5 and the FND_CONCURRENT_REQUESTS table is queried again.
11.    The next unprocessed rowid is picked from the process cache, and the processing starts.
12.    Concurrent manager process executes a SELECT-for-UPDATE statement to lock the STATUS_CODE in FND_CONCURRENT_PROCESSES for the request it’s about to process. This is the mechanism to ensure that each concurrent request is executed only once and only by one manager process even if many processes are running simultaneously. The SELECT-for-UPDATE statement can complete with “ORA-00054: resource busy and acquire with NOWAIT specified” or “0 rows updated” if another manager process has started processing the request already.
13. If the STATUS_CODE of the request was locked successfully, the concurrent manager executes the concurrent request. The processing moves to step 9 where the cached list of concurrent requests (rowids) is being checked again.

The workflow is not very complex, but it’s important to remember that there are normally multiple concurrent manager processes running  at the same time, and they are competing for the requests to run. This competition introduces another dimension of tuning for  settings, like number of concurrent manager processes, sleep seconds, or cache size. 

Sunday, November 25, 2018

Concurrent Manager Status using SQL

select decode(CONCURRENT_QUEUE_NAME,
 'FNDICM','Internal Manager',
 'FNDCRM','Conflict Resolution Manager',
 'AMSDMIN','Marketing Data Mining Manager',
 'C_AQCT_SVC','C AQCART Service',
 'FFTM','FastFormula Transaction Manager',
 'FNDCPOPP','Output Post Processor',
 'FNDSCH','Scheduler/Prereleaser Manager',
 'FNDSM_AQHERP','Service Manager: AQHERP',
 'FTE_TXN_MANAGER','Transportation Manager',
 'IEU_SH_CS','Session History Cleanup',
 'IEU_WL_CS',
 'UWQ Worklist Items Release for Crashed session',
 'INVMGR','Inventory Manager','
 INVTMRPM','INV Remote Procedure Manager','OAMCOLMGR',
 'OAM Metrics Collection Manager',
 'PASMGR','PA Streamline Manager',
 'PODAMGR','PO Document Approval Manager',
 'RCVOLTM','Receiving Transaction Manager',
 'STANDARD','Standard Manager',
 'WFALSNRSVC','Workflow Agent Listener Service',
 'WFMLRSVC','Workflow Mailer Service','WFWSSVC',
 'Workflow Document Web Services Service',
 'WMSTAMGR','WMS Task Archiving Manager',
 'XDP_APPL_SVC','SFM Application Monitoring Service',
 'XDP_CTRL_SVC',
 'SFM Controller Service',
 'XDP_Q_EVENT_SVC','SFM Event Manager Queue Service',
 'XDP_Q_FA_SVC','SFM Fulfillment Actions Queue Service',
 'XDP_Q_FE_READY_SVC','SFM Fulfillment Element Ready Queue Service',
 'XDP_Q_IN_MSG_SVC','SFM Inbound Messages Queue Service',
 'XDP_Q_ORDER_SVC',
 'SFM Order Queue Service',
 'XDP_Q_TIMER_SVC','SFM Timer Queue Service',
 'XDP_Q_WI_SVC','SFM Work Item Queue Service',
 'XDP_SMIT_SVC','SFM SM Interface Test Service') as "Concurrent Manager's Name",
  max_processes as "TARGET Processes",
  running_processes as "ACTUAL Processes" 
  from apps.fnd_concurrent_queues 
 where CONCURRENT_QUEUE_NAME 
 in ('FNDICM','FNDCRM','AMSDMIN','C_AQCT_SVC','FFTM','FNDCPOPP','FNDSCH',
'FNDSM_AQHERP','FTE_TXN_MANAGER','IEU_SH_CS','IEU_WL_CS','INVMGR','INVTMRPM',
 'OAMCOLMGR','PASMGR','PODAMGR','RCVOLTM','STANDARD','WFALSNRSVC','WFMLRSVC',
'WFWSSVC','WMSTAMGR','XDP_APPL_SVC','XDP_CTRL_SVC','XDP_Q_EVENT_SVC',
 'XDP_Q_FA_SVC','XDP_Q_FE_READY_SVC','XDP_Q_IN_MSG_SVC','XDP_Q_ORDER_SVC',
'XDP_Q_TIMER_SVC','XDP_Q_WI_SVC','XDP_SMIT_SVC')
 order by max_processes desc
 /


Execution and Sample Output


Concurrent Manager's Name                     |TARGET Processes|ACTUAL Processes
----------------------------------------------|----------------|----------------
Standard Manager                              |              15|              15
Marketing Data Mining Manager                 |               1|               1
                                              |               1|               1
Inventory Manager                             |               1|               1
PA Streamline Manager                         |               1|               1
Receiving Transaction Manager                 |               1|               1
Output Post Processor                         |               1|               1
Scheduler/Prereleaser Manager                 |               1|               1
Internal Manager                              |               1|               1
UWQ Worklist Items Release for Crashed session|               1|               1
Session History Cleanup                       |               1|               1
Conflict Resolution Manager                   |               1|               1
OAM Metrics Collection Manager                |               1|               1
PO Document Approval Manager                  |               1|               1
SFM Application Monitoring Service            |               0|               0
SFM SM Interface Test Service                 |               0|               0
SFM Timer Queue Service                       |               0|               0
SFM Inbound Messages Queue Service            |               0|               0
SFM Event Manager Queue Service               |               0|               0
SFM Fulfillment Element Ready Queue Service   |               0|               0
SFM Fulfillment Actions Queue Service         |               0|               0
SFM Work Item Queue Service                   |               0|               0
SFM Order Queue Service                       |               0|               0
SFM Controller Service                        |               0|               0
C AQCART Service                              |               0|               0
Transportation Manager                        |               0|               0
Workflow Agent Listener Service               |               0|               0
FastFormula Transaction Manager               |               0|               0
WMS Task Archiving Manager                    |               0|               0
Workflow Document Web Services Service        |               0|               0
Workflow Mailer Service                       |               0|               0

31 rows selected.


Wednesday, November 21, 2018

Trace Generation for concurrent requests

How to enable trace for Concurrent Requests


It is very common to enable trace for concurrent requests, the main reason for this is to troubleshooting performance problems. Here is a simple guide how to enable oracle session tracing for the request. 

1. Login as sysadmin 
2. Go to -> System Administrator -> Concurrent : Program -> Define and Press F11 
3. Enter the Concurrent Program Name (Eg. Journal Import) -> Press Ctrl + F11 
4. Enable the check box "Enable Trace" above "Copy To" button. Click on Save and close the window. 
5. Select Requests -> Run->Submit the concurrent request! 
6. The trace file will be created in the Database Server under the location of "udump" 

sql>
select value from v$parameter where name like '%user_dump_dest%'; 


Concurrent Programs with trace enabled
Shows which programs are defined with Trace enabled. Generally, you should enable trace for a program while you are debugging, but then you should turn it off when you're done. 

SELECT A.CONCURRENT_PROGRAM_NAME "Program Name",
SUBSTR(A.USER_CONCURRENT_PROGRAM_NAME,1,40) "User Program Name",
SUBSTR(B.USER_NAME,1,15) "Last Updated By",
SUBSTR(B.DESCRIPTION,1,25) DESCRIPTION
FROM APPS.FND_CONCURRENT_PROGRAMS_VL A, APPLSYS.FND_USER B
WHERE A.ENABLE_TRACE='Y'
AND A.LAST_UPDATED_BY=B.USER_ID;

Internal Concurrent Manager is down.


We can find the status of Internal Concurrent Manager with this script.
If it is down, then we need to take steps to turn it back on.
 You must run it as user applsys or sys.


SELECT DECODE(RUNNING_PROCESSES, 1, 'UP', 'DOWN') STATUS 
FROM APPLSYS.FND_CONCURRENT_QUEUES
WHERE CONCURRENT_QUEUE_NAME = 'FNDICM';


OUTPUT
-----------

SQL> SELECT DECODE(RUNNING_PROCESSES, 1, 'UP', 'DOWN') STATUS
FROM APPLSYS.FND_CONCURRENT_QUEUES
WHERE CONCURRENT_QUEUE_NAME = 'FNDICM';  2    3

STAT
----
UP


Monday, February 19, 2018

CPU intensive long running Concurrent Program

long running Concurrent program



Find the process that are consuming high CPU on DB Node.


oracledb=>prstat

   PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP
 26477 oracledb  2407M 2369M cpu2     0    0   2:59:40  13% oracle/39
  1958 oracledb  2393M 2355M cpu6     0    0   1:54:27  12% oracle/1
  2124 oracledb  2393M 2355M cpu2     0    0   1:53:35  12% oracle/1
  2202 oracledb  2393M 2355M cpu5     0    0   1:52:07  12% oracle/1



 Identify the PROCESS(Apps Node) from DB.


SQL>select s.sid, s.serial#, s.process, s.program, s.module 
    from v$session s, v$process p
    where s.paddr =p.addr and p.spid in ('26477','2124','1958','2202')
;


       SID    SERIAL# PROCESS      PROGRAM                                          MODULE
---------- ---------- ------------ ------------------------------------------------ --------------------
        93      35457 17991
       

On the APPLICATION Server, grep for the PROCESS:



apps=>ps -ef|grep 17991


apps 27982 25127  0 14:14:24 pts/2    0:00 grep 17991
apps 17991  9806  0 10:40:02 ?        0:02 ar60run P_CONC_REQUEST_ID=13318110 P_CORP='055' P_COMPANY='004' P_AS_OF_DATE='1


Get the Concurrent Request details



select /*+ CHOOSE*/
      'Node Name..............................: ' || q.node_name                          || chr(10) ||
      'Req id.................................: ' || Request_Id                           || chr(10) ||
      'Requestor..............................: ' || User_Name                            || chr(10) ||
      'Manager................................: ' || Q.User_Concurrent_Queue_Name         || chr(10) ||
      'Status code............................: ' || decode(status_code,'A', 'Waiting','B',
      'Resuming','D', 'Cancelled','E', 'Error', 'G', 'Warning', 'H',
      'On Hold', 'R', 'Normal','S', 'Suspended', 'T', 'Terminating',
                      'W', 'Paused', 'X','Terminated', status_code)                                       || chr(10) ||
      'Phase code.............................: '  || decode(phase_code, 'C', 'Completed',
      'I', 'Inactive', 'P', 'Pending', 'R', 'Running', phase_code)                        || chr(10) ||
      'Priority...............................: ' || Fcr.priority                         || chr(10) ||
      'Program................................: ' || Fcp.User_Concurrent_Program_Name     || chr(10) ||
      'Time so far ...........................: ' || trunc((sysdate-Fcr.actual_start_date)*24*60,2)||' min'|| chr(10) ||
      'Avg execution time in  30 days.........: ' ||  trunc(AVG_TIME,2)  ||' min'          || chr(10) ||
      'Max execution time in 30 days..........: ' ||  trunc(MAX_TIME,2)  ||' min'         || chr(10) ||
      'Fastest execution Time in 30 days......: ' ||trunc( MIN_TIME,2) || ' min'          || chr(10) ||
      'Number of executions in last 30 days...: ' ||occurance                             || chr(10) ||
      'ClientPID..............................: ' || Fcr.OS_PROCESS_ID                    || chr(10) ||
      'ServerPID..............................: ' || Fcr.ORACLE_PROCESS_ID     || chr(10) ||
      'Arguments passed to the program .......: ' ||Fcr.argument_text
       from apps.Fnd_Concurrent_Requests Fcr,
    apps.Fnd_Concurrent_Programs_vl Fcp,
    apps.Fnd_Oracle_Userid O,
    apps.Fnd_Concurrent_Processes P,
    apps.Fnd_Concurrent_Queues_vl Q,
    apps.Fnd_User,(select
    concurrent_program_id
    ,count(concurrent_program_id) occurance
    ,min(actual_completion_date-actual_start_date)*24*60 MIN_TIME
    ,max(actual_completion_date-actual_start_date)*24*60 MAX_TIME
    , avg(actual_completion_date-actual_start_date)*24*60 AVG_TIME
    from apps.fnd_concurrent_requests
    where status_code='C' and phase_code='C'
    and trunc(actual_start_date)>trunc(sysdate-30)
    group by concurrent_program_id
    having max(actual_completion_date-actual_start_date)*24*60 >5) CREQ
    where Controlling_Manager = Concurrent_Process_ID
    and ( P.Concurrent_Queue_ID=Q.Concurrent_Queue_ID AND P.Queue_Application_ID = Q.Application_ID )
    and O.Oracle_Id = Fcr.Oracle_Id and Request_Id in ('&REQID')
    and( Fcr.Program_Application_Id=Fcp.Application_Id
    and  Fcr.Concurrent_Program_Id=Fcp.Concurrent_Program_Id)
    and Requested_By = User_Id
    and Phase_Code = 'R' and status_code in ('R','T')
    --adding joins with new
    and Fcr.Concurrent_Program_Id=CREQ.Concurrent_Program_Id(+)
    Order By   Q.User_Concurrent_Queue_Name,q.node_name, Actual_Start_Date,Request_Id;



Enter value for reqid: 13318110
old  40:     and O.Oracle_Id = Fcr.Oracle_Id and Request_Id in ('&REQID')
new  40:     and O.Oracle_Id = Fcr.Oracle_Id and Request_Id in ('13318110')

Node Name..............................: server02
Req id.................................: 13318110
Requestor..............................: USER10
Manager................................: Standard Manager
Status code............................: Normal
Phase code.............................: Running
Priority...............................: 50
Program................................: Some Long Running Program
Time so far ...........................: 218.63 min
Avg execution time in  30 days.........:  min
Max execution time in 30 days..........:  min
Fastest execution Time in 30 days......:  min
Number of executions in last 30 days...:
ClientPID..............................:
ServerPID..............................:
Arguments passed to the program .......: , , , , 055, 004, , , , , 10-JUL-2014, , Merchant Number, , 71, Y, N

Sunday, August 13, 2017

Useful scripts for Concurrent Managers

Useful scripts for Concurrent Managers



Wednesday, August 9, 2017

R12: Concurrent Manager Status


Very nice script to check status concurrent manager status

Taken from http://applicationsdba.blogspot.com/
DBA's can make use of in sql prompt to check the concurrent manager's statuses with out going to GUI.

Run the Below Code in sqlplus as APPS account. 
set verify off
set lines 256
set trims ON
set pages 60
col concurrent_queue_id format 99999 heading "QUEUE Id"
col concurrent_queue_name format a20 trunc heading "QUEUE Code"
col user_concurrent_queue_name format a30 trunc heading "Concurrent Queue Name"
col max_processes format 999 heading "Max"
col running_processes format 999 heading "Act"
col running format 999 heading "Run"
col target_node format a15 heading "Node"
col status format a12 trunc heading "Status"
col run format 9999 heading 'Run'
col pend format 9999 heading 'Pending'
col cmgr_program FOR a65;
SELECT 'Instance : '
    ||NAME instance_name
FROM   v$database;

Prompt ===========================
Prompt concurrent manager status
Prompt ===========================
SELECT q.concurrent_queue_id,
      q.concurrent_queue_name,
      q.user_concurrent_queue_name,
      q.target_node,
      q.max_processes,
      q.running_processes,
      running.run                               running,
      pending.pend,
      Decode(q.control_code, 'D', 'Deactivating',
                             'E', 'Deactivated',
                             'N', 'Node unavai',
                             'A', 'Activating',
                             'X', 'Terminated',
                             'T', 'Terminating',
                             'V', 'Verifying',
                             'O', 'Suspending',
                             'P', 'Suspended',
                             'Q', 'Resuming',
                             'R', 'Restarting') status
FROM   (SELECT concurrent_queue_name,
              COUNT(phase_code) run
       FROM   fnd_concurrent_worker_requests
       WHERE  phase_code = 'R'
              AND hold_flag != 'Y'
              AND requested_start_date <= SYSDATE
       GROUP  BY concurrent_queue_name) running,
      (SELECT concurrent_queue_name,
              COUNT(phase_code) pend
       FROM   fnd_concurrent_worker_requests
       WHERE  phase_code = 'P'
              AND hold_flag != 'Y'
              AND requested_start_date <= SYSDATE
       GROUP  BY concurrent_queue_name) pending,
      apps.fnd_concurrent_queues_vl q
WHERE  q.concurrent_queue_name = running.concurrent_queue_name(+)
      AND q.concurrent_queue_name = pending.concurrent_queue_name(+)
      AND q.enabled_flag = 'Y'
ORDER  BY Decode(q.application_id, 0, Decode(q.concurrent_queue_id, 1, 1,4, 2)),
         Sign(q.max_processes) DESC,
         q.concurrent_queue_name,
         q.application_id;


             



    This is as equivalent as Concurrent -> Manager -> Administer in forms GUI.

            

Friday, November 11, 2016

How To Tell If Concurrent Managers For A Particular SID Are Running

 Doc ID 2089560.6

PROBLEM DESCRIPTION
-------------------

You are logged on to a server running multiple Oracle Applications instances, 
and you want to know if there are any concurrent managers processes running
for a particular instance running.

The following command:

     ps -ef | grep FNDLIBR

shows all FNDLIBR processes running on the server.  However, how can you tell 
which processes are associated with which instance?  How can you find all other 
concurrent manager processes and System PIDs?


SOLUTION DESCRIPTION
--------------------

You need to run $FND_TOP/sql/afcmstat.sql as the APPS user in the 
APPL_TOP/instance you are interested in.
 
The section labeled:  "Managers with their corresponding Oracle and System 
Process Id's" contains the information you are looking for.  If the internal 
manager is not running, you will not get a list under the heading.


These SQL scripts are useful in diagnosing concurrent manager related 
problems.  The names are listed below (located in $FND_TOP/sql): 
 
NAME              DESCRIPTION 
-----------------------------------------------------------------
 
afcmstat.sql    Lists active manager processes along with 
                defined max capacity to be in effect at the 
                present time.  Note: could be slow if table 
                FND_CONCURRENT_PROCESSES is large (since 
                history is maintained in it). 

afimchk.sql     Tells the status of ICM and PMON method in effect.
 
  
afrqrun.sql     Lists all the running, waiting (waiting to be 
                registered after sub requests completed) and 
                terminating requests. 
 
afrqwait.sql    Lists requests that are constrained and thus 
                waiting for the ICM to release them. 
 
afrqscm.sql     Prints log file name of managers that can run a 
                given request.  Helpful when a runnable request 
                stays pending to check for possible error 
                messages in manager log file. 
 
afcmcreq.sql    Prints the log file name of the manager that 
                processed the request (takes request id as 
                argument). 
  
afrqstat.sql    Summary of completed concurrent requests 
                grouped by completion status and execution type. 
 
afimlock.sql    Lists locks that the ICM is waiting to get. 
 
afcmrrq.sql     Lists managers that are currently running a 
                request (username, request id, program name, 
                start date, etc).

How To Change The Log And Output Location For Concurrent Managers?

A) The Logs and Output are located in $APPLCSF/$APPLLOG and  
$APPLCSF.

cd $APPLCSF/log
cd $APPLCSF/out

You can change the value of APPLCSF, APPLLOG and APPLOUT from the context file or
 you can do it from OAM. 

 The $APPLCSF/$APPLLOG and $APPLCSF/$APPLOUT directories should exist 
  and be accessible from the concurrent node.

B. Run autoconfig and bounce the concurrent managers for the changes to be implemented.

Monday, November 7, 2016

Cocurrent request run per week

Script to calculate number of requests run per week for performance gauging: 

SELECT COUNT(*) Total, sum(decode(greatest(0,ceil (sysdate - actual_completion_date)),
    least(7,ceil(sysdate-actual_completion_date) ),1,0)) Week4, sum(decode(greatest(8,ceil (sysdate - actual_completion_date)),
    least(14,ceil(sysdate-actual_completion_date) ),1,0)) Week3, sum(decode(greatest(15,ceil (sysdate -  actual_completion_date)),
    least(21,ceil(sysdate-actual_completion_date) ),1,0)) Week2,
    sum(decode(greatest(22,ceil (sysdate - actual_completion_date)), least(28,ceil(sysdate-actual_completion_date) ),1,0))
    Week1 FROM FND_CONCURRENT_REQUESTS WHERE ACTUAL_COMPLETION_DATE is not null;

Concurrent manager in Oracle APPS

 Concurrent Manager in Oracle Apps

Concurrent Processing = This is a batch processing job which runs in background while user works on front end transaction.
Concurrent Request = When user asks to run a program that request is
called Concurrent request.
Concurrent Manager = Concurrent Manager is the program which runs the concurrent requests.


There are three types of concurrent managers.
1.           Internal Concurrent Manager [ICM]
ICM ensures that all the concurrent manager is running. It starts and stops all concurrent managers. It also controls service managers in each node. Internal Monitor monitors the ICM and restarts ICM if ICM fails.
2.           Conflict Resolution Manager [CRM]
It checks concurrent program incompatibility.
3.           Standard Managaer
It takes care of processing any concurrent request. This manager runs always in 24x7 mode.

Now when a concurrent program is written, it needs to be executed daily at particular time.
If we do it manual, there might be chances of delays or it might happen that two different people run the same program at the same time which might lead problems.
 So we need a manager which can do all this tasks for us.
The responsibility for execution of concurrent programs is given to Concurrent Manager, which ensures that each concurrent program can run successfully without any conflicts.
They also ensures that the applications are not overwhelmed with requests.
They also manages the batch processing and report generation.

The default installation of Oracle Applications comes with a number of pre defined concurrent managers however you can create your custom concurrent managers to spread out the load of your job processing.
 Apart from taking care of the load of your jobs the concurrent managers can also schedule the jobs periodically.
Also we can assign specific priority and specific times to the different programs,
so that the concurrent managers can run them in specific workshifts.

Concurrent managers also allows you to tweak the number of concurrent process that it can handle concurrently.
 If any request exceed this prescribed limit they are automatically put on pending state.
 The processing of a request takes place based on the time of request submission and priority of the request submitted.

There are many pre-configured Concurrent Managers, each governing flow within each Oracle Apps areas.
In addition there are “super” Concurrent Managers whose job is to govern the behavior of the slave Concurrent Managers.
The Oracle e-Business suite has three important master Concurrent Managers:
·       Internal Concurrent Manager — The master manager is called the Internal Concurrent Manager (ICM) because it controls the behavior of all of the other managers, and because the ICM is the boss, it must be running before any other managers can be activated. The main functions of the ICM are to start up and shutdown the individual concurrent managers, and reset the other managers after one them has a failure.
·       Standard Manager — Another important master Concurrent Manager is called the Standard Manager (SM). The SM functions to run any reports and batch jobs that have not been defined to run in any specific product manager. Examples of specific concurrent managers include the Inventory Manager, CRP Inquiry Manager, and the Receivables Tax Manager.
·       Conflict Resolution Manager — The Conflict Resolution Manager (CRM) functions to check concurrent program definitions for incompatibility rules. However, the ICM can be configured to take over the CRM’s job to resolve incompatibilities.

Apart from these three concurrent manages there is another type of concurrent manager known as the Transaction Manager also exists. The transaction manager is responsible for taking the load off the concurrent request table for pooling the request submitted by the user.
The transaction manager takes care of these requests and sends it to standard manager directly.In a RAC environment the Transaction manager is required to be activated on each node of the RAC environment.
From the front end you could view the status of your concurrent manager by logging with the System Administration responsibility and going to the Concurrent Manager administer screen.

From the front end you could view the status of your concurrent manager by logging with the System Administration responsibility and going to the Concurrent Manager administer screen.
The status of concurrent managers and the nodes on which they are configured can also be known from the Oracle Applications manager.

How to start Concurrent Manager in R12

There are two ways to start concurrents manager.
1. $INST_TOP/admin/scripts/adcmctl.sh start apps/<apps password>
2. strtmgr.sh utility
A sample command is as follows.
$FND_TOP/bin/strtmgr sysmgr=apps/apps logfile=/tmp/log

some important parameters of strtmgr is as follows.
a. Mgrname = The name of manager. Default is "Internal Manager".
b. Sleep = The number of seconds ICM waits before checking new request from table FND_CONCURRENT_REQUEST.
c. Diag = Deault is N. Diag=Y means full diagionistic output will be written in log file.
d. Pmon = The number of sleep cycle ICM will wait before checking failed manager.
e. Quesiz





Location of Concurrent Manager Log file

For R12 
$INST_TOP/logs/appl




How to check the status of the concurrent manager

There are 3 ways to find the status.

1. Operating system level
If process FNDLIBR is running that means that concurrent manager is up and running.
$ ps -ef | grep FNDLIBR | grep appl*

2. From Forms
Go to System Administrator > Cocurrent > Manager > Administrator. If concurrent manager is running then the value of Actual and Target should be greater than or equal to 1.




3. Sql script
Run the following sql script to check the concurrent manager status.
$ cd $FND_TOP/sql
$ sqlplus -s apps/apps @afimchk.sql





How to Stop Concurrent Manager

1. $ADMIN_SCRIPTS_HOME/adcmctl.sh stop apps/<apps pw>

2. By killing FNDLIBR process issue -9 (kill -9 pid)

3. Individual concurrent manager can be stopped by navigating to Concurrent > Manager > Administrator.

4. Using CONCSUB Utility
$ CONCSUB username/pw SYSADMIN 'System Administrator' SYSADMIN WAIT=Y CONCURRENT FND ABORTs


What is CONCSUB Utility

CONCSUB Utility allows user to submit concurrent request from operating system level.
An example of that request is as follows.

CONCSUB <ORACLE ID WITH PASSWORD> <Responsibility Application Short Name> <Responsibility Name> [WAIT=<Wait Flag>] CONCURRENT <Concurrent Program Application Short Name> <Concurrent Program Name> [START=<Requested Start Date>] [REPEAT_DAYS=<Repeat Interval>] [REPEAT_END=<>] <Concurrent Program Argument>

Wait parameter = whether CONCSUB waits till request completes. W=Y means it return to Unix prompt immediately.


Flow of a Concurrent Request

Once Concurrent Request is submitted the following things happen ->

A. FND_CONCURRENT_REQUESTS table is updated with the request with scheduled time.
B. Once request is scheduled the concurrent manager checks the table FND_CONCURRENT_TABLES to find out if there is any incompatibility in program.
C. If there is any incompatibility CRM [Conflict Resolution Manager] takes care.
D. For no incompatibility it first checks whether there is any special manager who can take care the request else standard manager takes care.
E. Once completed FND_CONCURRENT_REQUEST table is updated with status.






Some Important phases of concurrent manager

A. Standby = Request is put in standby mode while CRM is resolving the incompatibility.
B. No Manager = CM is down or no manager was defined.
C. Disabled = Concurrent Program is disabled.








How to add or define a new Concurrent Manager

Go to System Administrator > Concurrent > Manager > Define.




The important parameters of the above screen is as follows.
a. Manager = Name of the concurrent manager
b. Type = What type of concurrent manager we are going to define. The options are Concurrent manager, Transactional Manager, internal Monitor etc..
c. Cache Size = If cache size is 5, CM reads 5 requests at a time from quesue and waits until those are completed before reading new records.
d. Consumer Group = A Resource Consumer Group is a group of users who has similar resource usage requirements. Like we can create LOW_GROUP, HIGH_RESOURCE_GROUP consumer group and assign it here.



Parallel Concurrent Processing Details

1. Node
This is only applicable if parallel conc processing is enabled. The node must be registered with EBS and it must be there in FND_NODES table.
2. System Queue
This is used only if we want to use OS queue instead of default conc manager queue.

Program Library
CM only runs those programs which is listed in program libraries.




Specialization Rules
If we want to run certain types of request only and include and exclude some Cons Request the this screen is used.

Work Shifts
It defines the time for which the concurrent manager will be active. To define workshifts go to Concurrent > Manager > Work Shifts.







Concurrent Manager Administration

Go to System Administrator > Cocurrent > Manager > Administrator.



Some important description and functionality of this screen.

Process Actual
The number of actual process running on that CM.
Process Target
The maximum number of process that can be active. Process Target >= Process Actual.
Running
The number of request currently running.


Controlling Parameter ->
Terminate
Immediately abort all running request and particular manager terminates. If we terminate IM then all the cns manager stops.
Deactivate
Here before stopping the manager all the requests get completed. This is the difference between shut down and terminate.
Restart
Verify
This is available only for IM. The process monitoring of othere concurrent manager by IM is known as PMON Cycle. Verify forces to PMON cycle to occur immediately.

Parallel Concurrent Processing

Parallel concurrent helps to distribute load across various nodes to utilize full hardware resources. The following are some of the architecture of parrallel concurrent processing.

1. Cluster Env
In a cluster environment, multiple computer/CPU, each representing a single node, share a common pool of disks. Oracle Database resides in that common disk whereas multiple instances of RAC run simultaneously on multiple nodes of cluster. CM is also divided in multiple nodes.

2. Massively Parallel env
Here, multiple nodes are housed in a single computer and all nodes share a common pool of disk. Separate RAC instances run simultaneously on multiple node.

3. Networked Env
Multiple computers of same type are connected via LAN to a single DB or a RAC DB.




How Parallel Concurrent Processing happens

Each conc manager is assigned a primary and secondary node. The CM starts in primary node by default. It changes to the secondary node once there are some faults in primary node. ICM can run on any of the node. It can activate and deactivate any CM. Due to heavy fault tolerance of ICM it is monitored by Internal Monitor [IM]. IM starts ICM if it will fail in any time.




Generic Service Management [GSM]




GSM is a new concept and powerful framework to manage services in different host machines. Some services such as oracle forms listener, reports server, apache web listener, workflow mailer can be integrated in this framework. With GSM, the ICM will manage these services in each hosts. And each hosts has a service manager which acts on behalf of ICM in that hosts. This service manager monitor and controls the services in that host and send the end result to ICM.

Concurrent Manager Processes
The concurrent managers are like other process which run on the oracle applications executable FNDLIBR. The FNDLIBR executable is located at $FND_TOP/bin.
You could also grep the FNDLIBR executable to check if any concurrent manager process are running
$ ps -ef|grep FNDLIBR
The $FND_TOP/sql/afcmstat.sql script gives you a list of concurrent managers and their respective status.
Below is the list of Most of the Concurrent manager processes.

FNDLIBR
manages following Managers
·       Marketing Data Mining Manager
·       Transportation Manager
·       Session History Cleanup
·       UWQ Worklist Items Release for Crashed session
·       Collections Manager
·       OAM Metrics Collection Manager
·       Contracts Core Concurrent Manager
·       Standard Manager
·       WMS Task Archiving Manager
·       Oracle Provisioning Manager
INVLIBR
manages following Managers
·       Inventory Manager
MRCLIB
manages following Managers
·       MRP Manager
PALIBR manages following Managers
·       PA Streamline Manager
FNDSM
The Generic Service Management Framework Process
·       FNDSM is executable and core component in GSM ( Generic Service Management Framework discussed above). You start FNDSM services via application listener on all Nodes in Application Tier in E-Business Suite.
Concurrent Manager Scripts
Oracle supplies several useful scripts, (located in $FND_TOP/sql directory), for monitoring the concurrent managers:
afcmstat.sql
Displays all the defined managers, their maximum capacity, pids, and their status.


afimchk.sql
Displays the status of ICM and PMON method in effect, the ICM’s log file, and determines if the concurrent manger monitor is running.
afcmcreq.sql
Displays the concurrent manager and the name of its log file that processed a request.


afrqwait.sql
Displays the requests that are pending, held, and scheduled.
afrqstat.sql
Displays of summary of concurrent request execution time and status since a particular date.
afqpmrid.sql
Displays the operating system process id of the FNDLIBR process based on a concurrent request id. The process id can then be used with the ORADEBUG utility.
afimlock.sql
Displays the process id, terminal, and process id that may be causing locks that the ICM and CRM are waiting to get. You should run this script if there are long delays when submitting jobs, or if you suspect the ICM is in a gridlock with another oracle process.