Friday, January 18, 2008

Concurrent Manager:
---------------------
A mechanism that runs concurrent programs.
A manager operates duringthe time and days defined by a work shift. A manager can run any concurrent program, or be specialized to run anyconcurrent program, or be specialized to run only certain kinds of programs.

Concurrent Program:
---------------------
A program that runs concurrently (at the same time) as other programs.
Concurrentprograms run as background processes, while you continue to work at your terminal.”A concurrent program is an instance of an execution file, along with parameter definitions and incompatibilities.

Concurrent programs use concurrent program executables to locate the correct execution file.
Several concurrent programs may use the same execution file to perform their specific tasks, each having different parameter defaults and incompatibilities.

Concurrent Program Executable
---------------------------------
A concurrent program executable links an execution file or and the method used to execute it with a defined concurrent program.

Under Concurrent Processing, an execution method may be a program written in a standard language, a reporting tool, or an operating system language.

An execution method can be :

1. A PL/SQL Stored Procedure,
2. An Oracle Tool such as Oracle Reports or SQL*Plus, a spawned process, or
3. An operating system host language (eg . Shell or DCL).

Concurrent Program Execution File
=========================

A concurrent program execution file is an operating system file or database stored procedure which contains your application logic and can be executed by either invoking it directly on the command line or by invoking a program which acts upon it.

For example, you run a Pro*C program by invoking it on the command line. You run a SQL script by running SQL*Plus and passing the name of the SQL script without the .sql extension.


Oracle Applications consists of several types of Concurrent Managers.But it also gives the end-user flexibility to define any Concurrent Manager and in any number, as per the requirement.

Key Managers pre-defined by Oracle:

1. Internal Concurrent Manager (ICM)
2.Conflict Resolution Manager (CRM)
3. Standard Manager (SM)


ICM

Controls all other CM's.
Main task is to ensure all other CM's are up and running.
It also starts and stops Service Manager's on each node .
It sets the no. of active processes, monitors, restarts and terminates all other conc. processes through requests made to the service manager.

ICM in turn is monitored by Internal Monitor, is responsible for starting the failed ICM in a local node.
IMP: There should be an IMON defined on each node.


CRM

Takes care of resolving the program incompatabilities and checks if a request in a queue can be run in parallel with the running request.

SM

Is always running (24 hours , 365 days ) and can take care of processing any concurrent request.
In case a request has no defined Manager to take care, SM takes care of it.


Starting And Stoping Concurrent Manager
===============================

In Oracle Applications 11i all startup shutdown scripts (let's say control Scripts ) in 11i(11.5.10) are in $OAD_TOP/admin/script/$CONTEXT_NAME where $OAD_TOP is also called as $COMMON_TOP and $CONTEXT_NAME is your SID_hostname.

The script to start/stop concurrent manager is adcmctl.sh where ad is application dba , cm is concurrent manager & ctl means control.

When you run adcmctl.sh it records execution of this command in text file with name adcmctl.txt at directory $COMMON_TOP/admin/log/$CONTEXT_NAME.

Remember adcmctl.sh call's another script "startmgr" which in turn calls "batchmgr" in $FND_TOP/bin and this is actual file which kicks up Internal Concurrent Manager Process (ICM) .
Lets check important parameter in this file

1. DISPLAY Set it to some valid XServer , if this is not set properly your reports display will fail (specially one with PDF or Bar code dislay)

2. DIAG_PARAM Diagnosis parameter it will take value Y or N with default N, If you encounter some error while starting Concurrent Manager you change this to Y and then extra logging will be enabled then check Concurrent Manager log file.

3. CONCSUB stands for CONC(Concurrent) SUB(Submit) , used to submit concurrent request like shut down concurrent manager.

4. SLEEP holds the number of seconds that the manager should wait between checks for new requests.

5. MGRNAME is the name of the manager for locking and log purposes. So you can find if this is icm(Internal Concurrent Manager), sm(Service Manager)

6. RESTART is set to N if the manager should not restart itself after a crash. Otherwise, it is an integer number of minutes. The manager will attempt a restart after an abnormal termination if the past invocation lasted for at least RESTART minutes.

7. PMON is the duration of time between process monitor checks (checks for failed workers). The unit of time is concurrent manager iterations (request table checks). Default Value is 20 .

8. QUESIZ is the duration of time between worker quantity checks (checks for number of active workers). The unit of time is process monitor checks.

Note -> PMON, QUESIZ and SLEEP are important for Concurrent Manager Tuning.


(A)adcmctl.sh apps/<>
(B)By findinging the FNDLIBR process on the server and Killing the same by issuing Kill -9.
(c)Individual CM's can be deactivated from the Forms using the navigation >
Concurrent > Manager > Administer
(D) Using the CONCSUB utility.

CONCSUB username/passwd SYSADMIN 'system Administrator' SYSADMIN WAIT=Y CONCURRENT FND ABORT

How to find Concurrent Manager Node :

1. SQLPLUS> select node_name from apps.fnd_nodes where support_cp='Y';

2. In context file (SID_hostname.xml ) under $APPL_TOP/admin , check for variable

< oa_var="s_isConc">YES< / TIER_NODE>,

YES means this is Concurrent Manager Node.

3. From Front-end,Check for Administer Concurrent Manager request under SYSADMIN responsibility.

4. From Server , "ps -ef grep FNDLIBR" under application User on all nodes where FND (Foundation) LIBR(Library) is executable.

Important Tables and Profiles

The most important activities of an Apps DBA are applcation of Patches ( roughly its 50% of the daily work , what an Apps DBA performs ).The other main activity he is envolved in is troubleshooting Concurrent Manager or CM issues.
I have listed some important Tables which as an Apps DBA , need to look for any relevant info. regarding these Task.

Concurrent Manager
--------------------
FND_CONCURRENT_QUEUES
FND_CONCURRENT_PROGRAMS
FND_CONCURRENT_REQUESTS
FND_CONCURRENT_REQUESTS_TL
FND_CONCURRENT_PROCESSES
FND_CONCURRENT_QUEUE_SIZE


FND
------------
FND_APPL_TOPS
FND_LOGINS
FND_USER
FND_NODES
FND_DM_NODES
FND_TNS_ALIASES
FND_RESPONSIBILITY
FND_RESPONSIBILITY_TL
FND_DATABASES
FND_UNSUCCESSFUL_LOGINS
FND_LANGUAGES
FND_APPLICATION
FND_PROFILE_OPTION_VALUES
FND_SVC_COMPONENTS
FND_SVC_COMPONENTS_PARAM_VALS



AD / Patches
---------------------
AD_APPLIED_PATCHES
AD_PATCH_DRIVERS
AD_BUGS
AD_INSTALL_PROCESSES
AD_SESSIONS
AD_APPL_TOPS


Profile Options Useful for DBA
Here is the list of few profile options which Apps DBA use frequently. It is not necessary that you as Apps DBA must know all profile options, all of this depends on your implementation..


Applications Help Web Agent
Applications Servlet Agent
Applications Web Agent
Concurrent: Active Request Limit
Concurrent: Hold Requests
Concurrent: Multiple Time Zones
Concurrent: Report Access Level
Concurrent: Report Copies
Concurrent: Request priority
Database Instance
Enable Security Group
FND: Debug Log Filename
FND: Debug Log Level
Forms Runtime Parameters
Gateway User ID
ICX: Discoverer Launcher
ICX: Forms Launcher
ICX: Report Launcher
ICX: Limit Connect
ICX: Limit time
ICX: Session Timeout
MO Operating Unit
Node Trust Level
RRA: Delete Temporary Files
RRA: Enabled
RRA: Service Prefix
RRA: Maximum Transfer Size
Self Service Personal Home Page Mode
Sign-On: Audit Level
Signon Password Failure Limit
Signon Password Hard to Guess
Signon Password Length
Signon Password No Reuse
Site Name
Socket Listener Port
TCF: Host
TCF: Port
TWO TASK
Viewer: Text

Flow of Concurrent Request
1. Once a concurrent request is submitted by the user, the table FND_CONCURRENT_Requests is automatically updated by the details of the request.

2. Once the request is scheduled to run, the CM’s checks the FND_CONCURRENT_TABLES to find the request compatibility with any other request.

3. If no incompatibilities found in the check, than request is assigned to the concerned Manager.
Note: If there is any special Manager to take care of the request , then it goes to queue of its manager else the standard Manager takes care of the request.

4. Once the Request is processed, the FND_CONCURRENT_REQUEST table is updated with the status.

5. A conc.request can have many PHASES , when its being processed by the Manager

6. Every Phase has corresponding STATUS.

PHASE 1.Completed

STATUS

Normal : The request completed normally.

Error :The request failed.Check the log file for details about the error.

Warning :Request completed with a warning.Warning is generated when upon completion task don't complete succesfully.

Cancelled :The request was cancelled before it was started.Terminated : When a running request was terminated.

PHASE 2.Running

STATUS

Normal: Request is running normal and no interfere is required.

Paused : Request is waiting for some other request to be finished.(Dependency )

Resuming :Paused request is resuming, this happens when dependent request completes.

Terminating :User or sysadmin chooses to terminate the request.

3.Pending

Normal : Request is waiting for CM.

Standby :Request is incompatible with some other request.CRM needs to resolve this.

Waiting :Dependency of request.

Scheduled :Request is scheduled to run at a point of time in future.

4.Inactive

No Manager : CM is down or No specialzed Manager is defined for this request

Disabled : Conc.Program rquested has not been enabled yet.

On Hold: Pending request has been kept on hold for time being.