Concurrent Processing and Concurrent Manager

  • Published on
    21-Dec-2015

  • View
    9

  • Download
    4

Embed Size (px)

DESCRIPTION

hi

Transcript

CONCURRENT PROCESSING AND CONCURRENT MANAGERA user typically performs two types of activities in Oracle Applications one online transaction and the other batch processing. The batch processing job is also known as Concurrent processing which allows the oracle application users to schedule jobs in background while the user can work with online data entry operations. When an oracle application user submits a request to run a program its called concurrent requests. Concurrent Manager are the programs, which are responsible for running the concurrent requests. When a user submits a report to be run as a concurrent request, the job enters in a request queue. The concurrent managers continuously read request from this master queue and run the requests based on the requests schedule, priority, and compatibility rules. The concurrent managers runs in background and they take care of initiating and completing the concurrent requests. Concurrent managers act as administrators of job processing in oracle applications and employ workers at the operating system to process the application user requests by running concurrent programs. Each manager can run any program or can be specialized to run only certain programs. Oracle application consists of several types of concurrent managers. That doesnt mean that you cant define any concurrent manager. You can define any number of concurrent managers as per your requirement. The key managers predefined by oracle includes internal concurrent manager conflit resolution manager, and standard manager.

INTERNAL CONCURRENT MANAGER;The internal concurrent manager controls all the other concurrent managers. Its main task is to ensure that all the other concurrent managers are up and running. The internal concurrent manager starts, sets the number of active processes, monitors, and terminates all other concurrent processes through requests made to the service manager, including restarting any failed processes. The ICM also starts and stops, and restarts the service manager for each node. The internal concurrent manager is in turn monitored by internal monitor which is responsible for starting the failed internal concurrent manager in a local node. There should be an internal monitor defined on each node.CONFLICT RESOLUTION MANAGERThe conflict resolution manager takes care of resolving the program incompatibilities and checks if a request in queue can be run in parallel with the running request.

STANDARD MANAGERThe standard manager is the master concurrent manager. This manager is always running and it can take care of processing any concurrent request, it has no specialization rules. This manager runs 24hours a day for365 days. The definition of this manager should never be altered. In case if you alter the definition of the standard manager and you have not defined additional managers to run your requests, some of the program may not run in a proper way.CONCURRENT PROGRAMA concurrent program is a program which is registered with AOL, when registering a program which AOL certain informations like program name, execution method and argument needs to be given. A concurrent program can be written in Oracle Tools: PL/SQL, SQL* Loader, SQL*PLUS, and oracle reports. Pro*C Host language(i.e., shell or DCL) When defining a concurrent program the following thing needs to be taken care. Selecting an executable file to run the program. Choosing the execution method for the program (when defining your executable in define concurrent program executable0 Defining parameters for the program, if any. Defining printing information. Specifying any incompatible programs that must not run while the program runs. Choosing whether to allow users to run this report from the run reports form or from within a form. If the latter option is chosen, the form from which you want to kick-off your program needs to be modified. If the first option is chosen, the program needs to be added to a report security group.CONCURRENT PROGRAM LIBRARIESA program library contains programs that can be called by the manager when concurrent manager are in operation. The workers (the OS background processes) of concurrent managers are the running instances of these program library executables. The system administrator may create a concurrent program library and assign it to a manager, or link bespoke immediate program to one of the existing program libraries. The advantage of linking in programs to a program library is, the assigned manager does not have to spawn another process to execute your job, hence, it will be faster to process. To create a new concurrent program library, the application developer/system administrator needs to perform various steps including Creating the immediate programs. Defining the concurrent program executable Defining the concurrent programs Defining the concurrent program library Assigning the program library to a manager.STARTING CONCURRENT MANAGERThere are two main ways of starting concurrent manager1. Using the script adcmct1.shThe concurrent manager can be started using the script adcmct1.sh which is located at $COMMON_TOP/admin/scripts/ directory for 11i and $INST_TOP/admin/scripts for R12.2. Using the startmgr utility in 11i and startmgr.sh in R12In FND_TOP/bin directory Internal manager in turn starts all the concurrent managers which is defined. LOCATION OF CONCURRENT MANAGER LOGFILES The concurrent manager log files can be located in one of the following places:1. For 11i if the environment variable APPLCSF is set the default location is $APPLCSF/$APPLLOG2. For 11i if the environment variable $APPLCSF is not set the logs files go to $FND_TOP/$APPLLOG3. The default name of the Concurrent manager log files is std.mgr . You can change these by setting the parameter log file=4. In R12 the location of CM logs is $INST_TOP/logs/appl/conc/log QUERYING THE CONCURRENT MANAGER There are many ways to find out if the concurrent manager is running or not and Apps DBA should aware of all the methods for checking the CM is up and running.1. Ps ef | grep FNDLIBR2. Navigation>systemAdmin>Concurrent>Manager>Administer3. If Actual and Target is same CM is up and running4. Checking by running the sql afimchk.sql available in $FND_TOP/sql.5. Using OAMSTOPPING CONCURRENT MANAGERSUBMITTING CONCURRENT REQUESTTHE CONCSUB UTILITYThe concurrent request can also be submitted from the command line syntax using the concurrent submission utility CONCSUB. It allows the users to submit the concurrent request at the OS level without login to the forms. This utility submits a concurrent request from the command line and returns to the command line once the request is completed.The syntax for the CONCSUB is given below Syntax: CONCSUB [WALT= Concurrent > Manager> Define, set primary and secundary node for all manager.

5) Set profile option 'Concurrent: PCP Instance Check' to OFF if database instance-sensitive failover isnotrequired. By setting it to 'ON', a concurrent manager will fail over to a secondary Application tier node if the database instance to which it is connected becomes unavailable for some reason.

Few Oracle Applications DBAs understand that sophisticated data dictionary queries can be run to reveal details about the workings within each Concurrent Manager. Oracle provides several internal tables that can be queried from SQL*Plus to see the status of the concurrent requests, and the most important are FND_CONCURRENT_PROGRAMS and FND_CONCURRENT_REQUESTS. Oracle supplies several useful scripts, (located in $FND_TOP/sql directory), for monitoring the concurrent managers:afcmstat.sqlDisplays all the defined managers, their maximum capacity, pids, and their status.

afimchk.sqlDisplays the status of ICM and PMON method in effect, the ICM's log file, and determines if the concurrent manger monitor is running.

afcmcreq.sqlDisplays the concurrent manager and the name of its log file that processed a request.

afrqwait.sqlDisplays the requests that are pending, held, and scheduled.

afrqstat.sqlDisplays of summary of concurrent request execution time and status since a particular date.

afqpmrid.sqlDisplays 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.sqlDisplays 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.

Apps DBA Tutorial 01 - Concurrent Manager 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 ManagaerIt takes care of processing any concurrent request. This manager runs always in 24x7 mode.

How to start Concurrent Manager in R12

There are two ways to start concurrents manager.1. $INST_TOP/admin/scripts/adcmctl.sh start apps/2. strtmgr.sh utilityA 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

The deault name of the log file is std.mgr.For 11i a. $APPLCSF/$APPLLOG if $APPLCSF env variable is setb. $FND_TOP/$APPLLOG if $APPLCSF env variable is not set

For R12 $INST_TOP/logs/appl/conc/log

How to check the status of the concurrent manager

There are 3 ways to find the status.

1. Operating system levelIf process FNDLIBR is running that means that concurrent manager is up and running.$ ps -ef | grep FNDLIBR | grep appmgr01

2. From FormsGo 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 scriptRun 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/

2. By killing FNDLIBR process using kill-9.

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 [WAIT=] CONCURRENT [START=] [REPEAT_DAYS=] [REPEAT_END=]

Wait parameter = whether CONCSUB waits till request completes. W=Y means it return to Unix promt 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 managerb. 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. NodeThis 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 QueueThis is used only if we want to use OS queue instead of default conc manager queue.

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

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

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

Concurrent Manager AdministrationGo to System Administrator > Cocurrent > Manager > Administrator.

Some important description and functionality of this screen.

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

Controlling Parameter ->

TerminateImmediately abort all running request and particular manager terminates. If we terminate IM then all the cm manager stops.DeactivateHere before stopping the manager all the requests get completed. This is the difference between shut down and terminate.RestartVerifyThis 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 E...