You are on page 1of 12

http://oracleappsdna.

com/2013/03/sqlquery-to-findout-executableconcurrent-program-and-its-parametersinformation/
/********************************************************* *PURPOSE: To Submit a Concurrent Request form backend * *AUTHOR: Shailender Thallam * **********************************************************/ -DECLARE l_responsibility_id NUMBER; l_application_id NUMBER; l_user_id NUMBER; l_request_id NUMBER; BEGIN SELECT DISTINCT fr.responsibility_id, frx.application_id INTO l_responsibility_id, l_application_id FROM apps.fnd_responsibility frx, apps.fnd_responsibility_tl fr WHERE fr.responsibility_id = frx.responsibility_id AND LOWER (fr.responsibility_name) LIKE LOWER('XXTest Resp'); -SELECT user_id INTO l_user_id FROM fnd_user WHERE user_name = 'STHALLAM'; ---To set environment context. -apps.fnd_global.apps_initialize(l_user_id,l_responsibility_id,l_application_id ); --Submitting Concurrent Requestl_request_id := fnd_request.submit_request(application=> 'XXCUST', program =>'XXEMP', description=> 'XXTest Employee Details', start_time=> sysdate, sub_request=> FALSE, argument1=> 'Smith'); COMMIT; -IF l_request_id = 0 THEN dbms_output.put_line('Concurrent request failed to submit'); ELSE dbms_output.put_line('Successfully Submitted the Concurrent Request'); END IF; -EXCEPTION WHEN OTHERS THEN dbms_output.put_line('Error While Submitting Concurrent Request '|| TO_CHAR(SQLCODE)||'-'||sqlerrm); END;

/ /************************************************************************** *PURPOSE: To find out information about a Concurrent Request * **************************************************************************/ SELECT fcrs.request_id, fcrs.user_concurrent_program_name, fcrs.actual_start_date, fcrs.actual_completion_date, FLOOR(((fcrs.actual_completion_datefcrs.actual_start_date)*24*60*60)/3600)||':'|| FLOOR((((fcrs.actual_completion_datefcrs.actual_start_date)*24*60*60) FLOOR(((fcrs.actual_completion_datefcrs.actual_start_date)*24*60*60)/3600)*3600)/60)||':'|| round((((fcrs.actual_completion_datefcrs.actual_start_date)*24*60*60) FLOOR(((fcrs.actual_completion_datefcrs.actual_start_date)*24*60*60)/3600)*3600 (FLOOR((((fcrs.actual_completion_datefcrs.actual_start_date)*24*60*60) FLOOR(((fcrs.actual_completion_datefcrs.actual_start_date)*24*60*60)/3600)*3600)/60)*60) )) "HOURS:MINUTES:SECONDS", fcrs.argument_text, fcrs.requestor, DECODE (fcrs.status_code, 'A', 'Waiting', 'B', 'Resuming', 'C', 'Normal', 'D', 'Cancelled', 'E', 'Errored', 'F', 'Scheduled', 'G', 'Warning', 'H', 'On Hold', 'I', 'Normal', 'M', 'No Manager', 'Q', 'Standby', 'R', 'Normal', 'S', 'Suspended', 'T', 'Terminating', 'U', 'Disabled', 'W', 'Paused', 'X', 'Terminated', 'Z', 'Waiting', fcrs.status_code ) "Status", decode(fcrs.phase_code, 'C','Completed', 'I','Inactive', 'R','Running', 'A','Active', fcrs.phase_code) "Phase Code", fcrs.completion_text, fcrs.responsibility_application_id, frt.responsibility_name, fcrs.save_output_flag, fcrs.request_date , decode (fcrs.execution_method_code, 'B', 'Request Set Stage Function', 'Q', 'SQL*Plus', 'H', 'Host', 'L', 'SQL*Loader',

'A', 'Spawned', 'I', 'PL/SQL Stored Procedure', 'P', 'Oracle Reports', 'S', 'Immediate', fcrs.execution_method_code ) execution_method , fcrs.concurrent_program_id, fcrs.program_short_name, fcrs.printer, fcrs.parent_request_id FROM fnd_conc_req_summary_v fcrs, fnd_responsibility_tl frt WHERE 1 = 1 AND user_concurrent_program_name LIKE '%' --and argument_text LIKE '%' --and requestor not in ('SYSADMIN','INVADMIN') --and request_id = 9686914 AND frt.LANGUAGE = 'US' AND fcrs.responsibility_id = frt.responsibility_id --and fcrs.actual_start_date < sysdate --and fcrs.phase_code = 'R' --and fcrs.status_code = 'X' --and fcrs.status_code not in ('P','D','Q','C') --and trunc(fcrs.actual_start_date) =trunc(sysdate) --and trunc(fcrs.actual_completion_date) = trunc(sysdate) ORDER BY fcrs.actual_start_date DESC;

/************************************************** *PURPOSE: To Create an Executable from backend * *AUTHOR: Shailender Thallam * ***************************************************/ -DECLARE -l_executable VARCHAR2 (200); l_application VARCHAR2 (200); l_short_name VARCHAR2 (200); l_description VARCHAR2 (200); l_execution_method VARCHAR2 (200); l_execution_file_name VARCHAR2 (200); l_subroutine_name VARCHAR2 (200); l_icon_name VARCHAR2 (200); l_language_code VARCHAR2 (200); l_execution_file_path VARCHAR2 (200); l_check VARCHAR2 (2); -BEGIN -l_executable := 'XX_ORACLEAPPSDNA_EXE'; l_application := 'CUSTOM Custom'; -- Your target application name l_short_name := 'XX_ORACLEAPPSDNA_EXE'; l_description := 'Test Script for creating Executable from Backend'; l_execution_method := 'PL/SQL Stored Procedure'; l_execution_file_name := 'XX_ORACLEAPPSDNA_PKG.MAIN'; l_subroutine_name := NULL; l_icon_name := NULL; l_language_code := 'US'; l_execution_file_path := NULL; ---Calling API to create executable -apps.fnd_program.executable (executable => l_executable, application => l_application, short_name => l_short_name, description => l_description, execution_method => l_execution_method, execution_file_name => l_execution_file_name, subroutine_name => l_subroutine_name, icon_name => l_icon_name, language_code => l_language_code, execution_file_path => l_execution_file_path ); COMMIT; BEGIN ---To check whether executable is created or not --

SELECT 'Y' INTO l_check FROM fnd_executables WHERE executable_name = 'XX_ORACLEAPPSDNA_EXE'; -DBMS_OUTPUT.put_line ('Executable Created Successfully'); -EXCEPTION WHEN NO_DATA_FOUND THEN DBMS_OUTPUT.put_line ('Executable Registration Failed'); END; END;

View from front end application:

1. The above script inserts data into FND_EXECUTABLES and FND_EXECUTABLES_TL tables 2. Execute the below query to find out different Execution Methods
SELECT MEANING "Execution_Method" FROM fnd_lookup_values WHERE lookup_type = 'CP_EXECUTION_METHOD_CODE' AND enabled_flag = 'Y';

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 enduser 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 CMs 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.

You might also like