Monday, November 7, 2016

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.





2 comments:

Anonymous said...

very easy explanation and easy to understand

Anonymous said...

Very easy to understand. Thankyou