Monday, August 31, 2009

XML Publisher report and RDF errored out

Problem: XML publisher and RDF report are erroring out.

Solution: This is something problem related with processes. Please contact your DBA Team and check following.
Xvfb and twm processes running on the server were not stable. And were getting killed interminently.
Probably that was causing the error.

Incompatibility not set between concurrent programs in Control Env.

Problem: In development Env, I set the Incompability between concurrent program with itself. but when this changes was move to control env then incompability didn't set.

Solution: In development env when i set the incompability then in background a concurrent pgm "Verify Concurrent Managers" is launched.

Use of FND_REQUEST.SET_MODE inside a DB Trigger

Syntax:
FND_REQUEST.SET_MODE(TRUE);
-------------------------------------------------------------------
Normally when a database session is setup, to submit a concurrent request to run concurrent program 'XXXXXXXXXX'.
Note that normally a COMMIT is required following the FND_REQUEST.SUBMIT_REQUEST, otherwise the request will not actually be submitted, however a COMMIT cannot be issued within a trigger. Because the Mode was set to TRUE (i.e. trigger) earlier in this trigger, a COMMIT is not needed.

Friday, August 28, 2009

Version of Jdeveloper 9i for Apps 11.5.10 CU2

Download the patch: 4573517 (Oracle9i JDeveloper with OA Extension for 11.5.10 CU2)

Profile for OA Framework

Lists of Profile used for OA Framework:

1) Personalize Self-Service Defn / FND_CUSTOM_OA_DEFINTION
2) Disable Self-service Personal / FND_DISABLE_OA_CUSTOMIZATIONS
3) FND: Personalization Region Link Enabled / FND_PERSONALIZATION_REGION_LINK_ENABLED
4) Fnd Xliff Export Root Path / FND_XLIFF_EXPORT_ROOT_PATH
5) Xliff Import Root Path / FND_XLIFF_IMPORT_ROOT_PATH
6) FND: Personalization Document Root Path / FND_PERZ_DOC_ROOT_PATH
7) FND: Diagnostics / FND_DIAGNOSTICS

Scripts of Oracle Apps Customization and Implementation

To deploy any custom code or Application, we need upload into server.
1) For oracle forms.
Compile the forms using the command:
f60gen module='XXXXXXXX.fmb' userid=apps/apps
2) For custom PLL.
f60gen module=calendar.pll userid=apps/apps module_type=library
3) For Form personalization

1) Login into Middle Tier.
2) $AUG_TOP/forms_personal (This is the directory where the extracted Form Personalizations reside).
3) Enter form_pers_download where is the short name for the form in all caps. (From the example above, you would enter form_pers_download OEXOEORD.)

4) AOL Related Scripts

1. Download FND Messages.
For all the message names which starts with XXT_REGN,
FNDLOAD apps/ 0 Y DOWNLOAD $FND_TOP/patch/115/import/afmdmsg.lct .ldt FND_NEW_MESSAGES MESSAGE_NAME=XXT_REGN%
For a particular message XXT_REGN_LAUNCH_SUCCESS
FNDLOAD apps/ 0 Y DOWNLOAD $FND_TOP/patch/115/import/afmdmsg.lct .ldt FND_NEW_MESSAGES MESSAGE_NAME= XXT_REGN_LAUNCH_SUCCESS

2. Upload the FND Messages.
$FND_TOP/bin/FNDLOAD apps/ 0 Y UPLOAD $FND_TOP/patch/115/import/afmdmsg.lct .ldt
3. Download the FND Lookups.
To download all the lookups starts with XXT_REGN,
FNDLOAD apps/ 0 Y DOWNLOAD aflvmlu.lct .ldt FND_LOOKUP_TYPE LOOKUP_TYPE=XXT_REGN%
For a particular Lookup XXT_REGN_STATUS
FNDLOAD apps/ 0 Y DOWNLOAD aflvmlu.lct .ldt FND_LOOKUP_TYPE LOOKUP_TYPE=XXT_REGN_STATUS
4. Upload the FND Lookups.
$FND_TOP/bin/FNDLOAD apps/ 0 Y UPLOAD $FND_TOP/patch/115/import/aflvmlu.lct $CUST_TOP/.ldt
5. Download the FND Responsibility
FNDLOAD apps/ 0 Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct .ldt FND_RESPONSIBILITY RESPONSIBILITY_NAME='Custom page Test Resp'
(Or)
FNDLOAD apps/ 0 Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct .ldt FND_RESPONSIBILITY APPLICATION_SHORT_NAME='XXPO' RESP_KEY=''
6. Upload FND Responsibility
FNDLOAD apps/ 0 Y UPLOAD $FND_TOP/patch/115/import/afscursp.lct .ldt

7. Download the FND Grants
FNDLOAD apps/ 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct .ldt GRANT GNT_MENU_NAME=
8. Upload the FND Grants
$FND_TOP/bin/FNDLOAD apps/ 0 Y UPLOAD $FND_TOP/patch/115/import/afsload.lct $CUST_TOP/.ldt
9. Download FND Menu
Download the menus which starts with XXT_PON_REGN,
FNDSLOAD apps/ 0 Y LOCAL .ldt DOWNLOAD XXT_PON_REGN%
Download a particular Menu,
FNDSLOAD apps/ 0 Y LOCAL .ldt DOWNLOAD XXT_PON_REGN_LAUNCH
10. Upload the Menu.
if $FND_TOP/bin/FNDSLOAD apps/ 0 Y LOCAL $CUST_TOP/install/import/AR/.ldt UPLOAD

11. Download FND Function:
FNDLOAD apps/ 0 Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct .ldt FUNCTION FUNCTION_NAME=
12. Upload FND Functions.
FNDLOAD apps/ 0 Y UPLOAD $FND_TOP/patch/115/import/afsload.lct .ldt

13. Download AK Attributes
java oracle.apps.ak.akload apps apps THIN "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(Host = )(Port = )) (CONNECT_DATA = (SID = )))" DOWNLOAD .ldt GET CUSTOM_REGION AMS AMS_ASSOCIATE_DELV
AMS - Application Short Name
AMS_ASSOCIATE_DELV - Region where the attribute attached
14. Upload AK Attributes
java oracle.apps.ak.akload apps apps THIN "(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(Host = sdniodb15)(Port = 40001)) (CONNECT_DATA = (SID = OMO0)))" UPLOAD ATTRIBUTE_LDT_NAME>.ldt UPDATE GERMAN_GERMANY.WE8ISO8859P1

Scripts for OAFramework Customization

2.1 OAFramework page related scripts.
2.2 Upload PG.xml files from the jdeveloper directory.
2.3 Change the package structure, < > according to your project
1.
Upload a Single PG.xml file
\jdevbin\jdev\bin\import \jdevbin\jdev\myclasses\xxt\oracle\apps\pon\registration\webui\XXTSupplierRegistrationPG.xml -username apps -password apps -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=))(CONNECT_DATA=(SID=)))" -rootDir \jdevbin\jdev\myclasses\ -rootPackage /

2. Upload multiple PG.xml files
/jdevbin/jdev/bin/import /jdevbin/jdev/myclasses /oracle/apps/xxpo/pdt/ordering/webui -rootDir /jdevbin/jdev/myclasses / -username apps -password -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=))(CONNECT_DATA=(SID=)))" -includeSubpackages -jdk13 -mmddir /jdevbin/jdev/lib/ext/jrad/config/mmd -rootPackage /

3. View the PG.xml from the database in TOAD or SQLDeveloper.
Begin
Jdr_utils.printDocument(‘/oracle/apps/pon/award/completion/webui/ponCompleteAward2PG’);
End;
4. To find the personalized file path for a particular PG.xml
begin
jdr_utils.listCustomizations('/oracle/apps/fnd/framework/navigate/webui/AppsNavigateMobilePG');
end;
Will give /oracle/apps/fnd/framework/navigate/webui/customizations/site/0/AppsNavigateMobilePG
When the page is personalized at site level.
5. To download the personalized file, first run the above script in SQL, that will display the full path for the personalized file, then run the below command
Eg.
Begin
Jdr_utils.printDocument(‘/oracle/apps/fnd/framework/navigate/webui/customizations/site/0/AppsNavigateMobilePG’);
End;
Save the file as AppsNavigateMobilePG.xml in the mentioned path and import into database using the above script.
6. To create translations for the personalized page or for a custom page, download the corresponding xlf file for the personalized page or the custom page. Then change the prompts in the destination language and import the page again.
Extract XLF file for a particular directory (For arabic language, for a different language, change accordingly).
\jdevbin\jdev\bin\xliffextract /xxt/oracle/apps/pon/registration/webui -includeSubpackages -mmd_dir D:\Jdev1150CU2\jdevbin\jdev\lib\ext\jrad\config\mmd -root D:\Temp\XLIF\registration -xliff_dir D:\Temp\XLIF\registration -source db -username apps -password -dbconnection "(DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=))(CONNECT_DATA=(SID=)))" -languages ar-AE
Extract XLF file for a particular file(For arabic language, for a different language, change accordingly).
\jdevbin\jdev\bin\xliffextract /oracle/apps/pon/outcome/creation/webui/customizations/site/0/ponCreatePOPG -root D:\temp -xliff_dir D:\temp -mmd_dir \jdevbin\jdev\lib\ext\jrad\config\mmd\ -source db -username apps -password -dbconnection " (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL= TCP)(HOST = )(PORT = )) ) (CONNECT_DATA = (SERVICE_NAME = ) ) )" -languages ar-AE

7. When you have the Substitutions upload the JPX using the following script from the UNIX prompt,
java oracle.jrad.tools.xml.importer.JPXImporter $CUST_TOP/TestProject.jpx -username $APPS_NAME -password $APPS_PASSWORD -dbconnection "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(Host=)(Port=)) (CONNECT_DATA=(SID=)))"
8. To find the personalizations for a particular object or for the whole system or for a particular package.
Login with the user who has Functional Administrator responsibility, you search the Object you have substituted (Functional Administrator=>Personalization=>Import/Export).
Search with a particular path, Eg. /oracle/apps/icx will give all the personalization under the path.
If the the profile option “FND: Personalization Document Root Path” set properly, the personalization can be exported to the system directly.

Restrict users to see button enabled if they choose other org except 'MST'.








This has been done through personalization.

Through Concurrent Program create Category and Assign Category to Category Sets

Concurrent Program create Category and Assign Category to Category Sets.
In this concurrent program you need to pass the Category sets name and category.
First category is created in mtl_categories through API.
Second category is assigned category sets through API.
set echo on
set feedback on
CREATE OR REPLACE PACKAGE ajay_inv_util_pkg IS
PROCEDURE create_category ( errbuf OUT VARCHAR2,
retcode OUT VARCHAR2,
i_category_set IN VARCHAR2,
i_category_name IN VARCHAR2 );
END ajay_inv_util_pkg;
/
CREATE OR REPLACE PACKAGE BODY ajay_inv_util_pkg IS
PROCEDURE create_category ( errbuf OUT VARCHAR2,
retcode OUT VARCHAR2,
i_category_set IN VARCHAR2,
i_category_name IN VARCHAR2 )
IS
l_category_rec INV_ITEM_CATEGORY_PUB.CATEGORY_REC_TYPE;
o_return_status VARCHAR2(100);
o_errorcode VARCHAR2(500);
o_msg_count VARCHAR2(100);
o_msg_data VARCHAR2(1000);
xcategory_set_id NUMBER;
xcategory_id NUMBER;
xparent_category_id NUMBER;
v_count NUMBER;
BEGIN
fnd_file.put_line(fnd_file.log,'******************************************');
fnd_file.put_line(fnd_file.log,'Create Category Procedure Begins ');
fnd_file.put_line(fnd_file.log,'Parameter Entered !!!! ');
fnd_file.put_line(fnd_file.log,'Category Set Name: - 'i_category_set);
fnd_file.put_line(fnd_file.log,'Category Name: - 'i_category_name);
fnd_file.put_line(fnd_file.log,'******************************************');
-- Intialize the Parameters.
l_category_rec := NULL;
l_category_rec.segment1 := i_category_name;
l_category_rec.description := i_category_name; -- Get the Parameters Values to pass into API. BEGIN
SELECT category_set_id, structure_id, structure_name, 'Y', 'N'
INTO xcategory_set_id, l_category_rec.structure_id, l_category_rec.structure_code, l_category_rec.enabled_flag, l_category_rec.summary_flag
FROM mtl_category_sets_v
WHERE category_set_name = i_category_set;
EXCEPTION
WHEN NO_DATA_FOUND THEN
xcategory_set_id := null;
l_category_rec.structure_id := null;
l_category_rec.structure_code := null;
l_category_rec.enabled_flag := null;
l_category_rec.summary_flag := null;
fnd_file.put_line(fnd_file.log, 'Category Set Name Already Not Defined: 'i_category_set); retcode :=1;
WHEN OTHERS THEN
fnd_file.put_line(fnd_file.log,'*****************'); -- Complete the program with error. retcode :=1;
errbuf := SUBSTR(SQLERRM,1,50)SQLCODE;
fnd_file.put_line(fnd_file.log,'Problem finding Catg_set: 'errbuf);
END;---- After the category record is loaded, then call the create_category api to-- create the new mtl_categories record. -----------------------------------------------------------------------------
-- 1. Create_Category ----------------------------------------------------------------------------/*# * Use this API to create a category. */
BEGIN
select count(segment1)
INTO v_count
from mtl_categories
where structure_id = l_category_rec.structure_id
and segment1 = l_category_rec.segment1;END;
IF v_count = 0 THEN-- Print the Parameters entered by User for this Report.
fnd_file.put_line(fnd_file.log,'******************************************');
fnd_file.put_line(fnd_file.log,'Passing Parameters Values into API Inv_Item_Category_Pub.Create_Category Begins ');
fnd_file.put_line(fnd_file.log,'Structure ID: - 'l_category_rec.structure_id);
fnd_file.put_line(fnd_file.log,'Structure Code: - 'l_category_rec.structure_code);
fnd_file.put_line(fnd_file.log,'Description: - 'l_category_rec.description);
fnd_file.put_line(fnd_file.log,'Summary Flag: - 'l_category_rec.summary_flag);
fnd_file.put_line(fnd_file.log,'Enabled Flag: - 'l_category_rec.enabled_flag);
fnd_file.put_line(fnd_file.log,'******************************************');
Inv_Item_Category_Pub.Create_Category ( p_api_version => 1.0,
p_init_msg_list => FND_API.G_FALSE,
p_commit => FND_API.G_FALSE,
x_return_status => o_return_status,
x_errorcode => o_errorcode,
x_msg_count => o_msg_count,
x_msg_data => o_msg_data,
p_category_rec => l_category_rec,
x_category_id => xcategory_id );
IF o_return_Status = 'S' THEN
fnd_file.put_line(fnd_file.log,'*****************');
fnd_file.put_line(fnd_file.log, 'Category successfully created. New Category Id = 'xcategory_id); fnd_file.put_line(fnd_file.log, 'Segment Combination = 'l_category_rec.segment1'.'); fnd_file.put_line(fnd_file.log,'*****************'); retcode :=0; -- API to create a valid Category in Category Sets ----------------------------------------------------------------------------- /*# * Use this API to for assigning a category to a category set. A category will be available * in the list of valid categoies for a category set only if it is assigned to the category set. * @param p_category_id contains the category id of the category being created. * @param p_category_set_id identifies the category set in which the category is to be created. * @param p_parent_category_id if NULL then this category becomes a first level child in the category set. * @rep:displayname Assign a Category to a Category Set. * @rep:scope public */
-- Print the Parameters entered by User for this Report.fnd_file.put_line(fnd_file.log,'******************************************');
fnd_file.put_line(fnd_file.log,'Passing Parameters Values into API Inv_Item_Category_Pub.Create_Valid_Category ');
fnd_file.put_line(fnd_file.log,'Category Set ID: - 'xcategory_set_id);
fnd_file.put_line(fnd_file.log,'Category ID: - 'xcategory_id);
fnd_file.put_line(fnd_file.log,'Parent Category ID: - ''null');fnd_file.put_line(fnd_file.log,'******************************************');
Inv_Item_Category_Pub.Create_Valid_Category ( p_api_version => 1.0,
p_init_msg_list => FND_API.G_FALSE,
p_commit => FND_API.G_TRUE,
p_category_set_id => xcategory_set_id,
p_category_id => xcategory_id,
p_parent_category_id => xparent_category_id,
x_return_status => o_return_status,
x_errorcode => o_errorcode,
x_msg_count => o_msg_count,
x_msg_data => o_msg_data );
IF o_return_Status = 'S' THEN
fnd_file.put_line(fnd_file.log,'*****************');
fnd_file.put_line(fnd_file.log, 'Category successfully added to Category Set.');
fnd_file.put_line(fnd_file.log, 'Category Set Name : 'i_category_set'.');
fnd_file.put_line(fnd_file.log, 'Category Name : 'i_category_name'.');
fnd_file.put_line(fnd_file.log,'*****************'); ELSE fnd_file.put_line(fnd_file.log,'*****************');
fnd_file.put_line(fnd_file.log,'#API Error while adding Category to Category Set'); fnd_file.put_line(fnd_file.log, 'Category Set Name = 'i_category_set'.');
fnd_file.put_line(fnd_file.log, 'Category Name = 'i_category_name'.');
IF o_msg_count > 0 THEN FOR i IN 1 .. o_msg_count
LOOP
fnd_file.put_line(fnd_file.log, i '.' SUBSTR(fnd_msg_pub.get(p_encoded => fnd_api.g_false), 1, 255));
END LOOP;
END IF;
fnd_file.put_line(fnd_file.log,'*****************');
fnd_file.put_line(fnd_file.log,'*****************'); -- Complete the program with error. retcode :=1;
END IF;
ELSE fnd_file.put_line(fnd_file.log,'*****************');
fnd_file.put_line(fnd_file.log,'#API Error while creating Category');
fnd_file.put_line(fnd_file.log, 'Segment Combination = 'l_category_rec.segment1'.');
IF o_msg_count > 0 THEN
FOR i IN 1 .. o_msg_count
LOOP
fnd_file.put_line(fnd_file.log, i '.' SUBSTR(fnd_msg_pub.get(p_encoded => fnd_api.g_false), 1, 255));
END LOOP;
END IF;
fnd_file.put_line(fnd_file.log,'*****************'); -- Complete the program with error. retcode :=1;
END IF;
ELSE
fnd_file.put_line(fnd_file.log,'******************************************');
fnd_file.put_line(fnd_file.log, 'Do not call API Inv_Item_Category_Pub.Create_Category Begins ');
fnd_file.put_line(fnd_file.log, 'The category already exist for structure ');fnd_file.put_line(fnd_file.log,'******************************************');
END IF;
EXCEPTION
WHEN OTHERS THEN
fnd_file.put_line(fnd_file.log,'*****************');
fnd_file.put_line(fnd_file.log, 'Issue while in ajay_inv_util_pkg.Create_Category');
fnd_file.put_line(fnd_file.log,'*****************'); -- Complete the program with error. retcode :=SQLCODE; errbuf := SUBSTR(SQLERRM,1,50); FND_FILE.PUT_LINE(FND_FILE.LOG,retcode': 'errbuf);
END create_category;
END ajay_inv_util_pkg;
/
EXIT

Useful Queries for Oracle Applications 11i

1) Query to get list of responsibilities.
SELECT (SELECT application_short_name FROM fnd_application fa
WHERE fa.application_id = frt.application_id) application,
frt.responsibility_id, frt.responsibility_name
FROM apps.fnd_responsibility_tl frt;

2) Query to get Menus Associated with responsibility
SELECT DISTINCT a.responsibility_name, c.user_menu_name FROM apps.fnd_responsibility_tl a,
apps.fnd_responsibility b,
apps.fnd_menus_tl c,
apps.fnd_menus d,
apps.fnd_application_tl e,
apps.fnd_application f
WHERE a.responsibility_id(+) = b.responsibility_id
AND a.responsibility_id = ‘20538’
AND b.menu_id = c.menu_id
AND b.menu_id = d.menu_id
AND e.application_id = f.application_id
AND f.application_id = b.application_id
AND a.LANGUAGE = 'US';
3) Query to get submenus and Function attached to this Main menu.
SELECT c.prompt, c.description
FROM apps.fnd_menus_tl a, fnd_menu_entries_tl c
WHERE a.menu_id = c.menu_id AND a.user_menu_name = 'AS185112_TEST';
4) Query to get assigned responsibility to a user.
SELECT UNIQUE u.user_id, SUBSTR (u.user_name, 1, 30) user_name,
SUBSTR (r.responsibility_name, 1, 60) responsiblity,
SUBSTR (a.application_name, 1, 50) application
FROM fnd_user u,
fnd_user_resp_groups g,
fnd_application_tl a,
fnd_responsibility_tl r
WHERE g.user_id(+) = u.user_id
AND g.responsibility_application_id = a.application_id
AND a.application_id = r.application_id
AND g.responsibility_id = r.responsibility_id
ORDER BY SUBSTR (user_name, 1, 30),
SUBSTR (a.application_name, 1, 50),
SUBSTR (r.responsibility_name, 1, 60);
5) Query to get responsibility and attached request groups
SELECT responsibility_name responsibility, request_group_name,
frg.description FROM fnd_request_groups frg, fnd_responsibility_vl frv
WHERE frv.request_group_id = frg.request_group_id
ORDER BY responsibility_name;
6) Query to get modified profile options.
SELECT t.user_profile_option_name, profile_option_value,
v.creation_date,
v.last_update_date,
v.creation_date - v.last_update_date "Change Date",
(SELECT UNIQUE user_name
FROM fnd_user
WHERE user_id = v.created_by) "Created By",
(SELECT user_name
FROM fnd_user
WHERE user_id = v.last_updated_by) "Last Update By"
FROM fnd_profile_options o,
fnd_profile_option_values v,
fnd_profile_options_tl t
WHERE o.profile_option_id = v.profile_option_id
AND o.application_id = v.application_id
AND start_date_active <= SYSDATE AND NVL (end_date_active, SYSDATE) >= SYSDATE
AND o.profile_option_name = t.profile_option_name
AND level_id = 10001
AND t.LANGUAGE IN (SELECT language_code
FROM fnd_languages
WHERE installed_flag = 'B'
UNION
SELECT nls_language
FROM fnd_languages
WHERE installed_flag = 'B')
ORDER BY user_profile_option_name;

7) Query to get the details of Form Personalization
SELECT ffft.user_function_name "User Form Name", ffcr.SEQUENCE,
ffcr.description, ffcr.rule_type, ffcr.enabled, ffcr.trigger_event,
ffcr.trigger_object, ffcr.condition, ffcr.fire_in_enter_query,
(SELECT user_name
FROM fnd_user fu
WHERE fu.user_id = ffcr.created_by) "Created By "
FROM fnd_form_custom_rules ffcr, fnd_form_functions_vl ffft
WHERE ffcr.ID = ffft.function_id
ORDER BY 1;

8) Query to get Patch Level.
SELECT a.application_name,
DECODE (b.status, 'I', 'Installed', 'S', 'Shared', 'N/A') status,
patch_level
FROM apps.fnd_application_vl a, apps.fnd_product_installations b
WHERE a.application_id = b.application_id;

9) Query to get all Functions
SELECT function_id, user_function_name, creation_date, description
FROM applsys.fnd_form_functions_tl
y order by user_function_name;

10 Query to get all Request attached to a responsibility
SELECT responsibility_name , frg.request_group_name,
fcpv.user_concurrent_program_name, fcpv.description
FROM fnd_request_groups frg,
fnd_request_group_units frgu,
fnd_concurrent_programs_vl fcpv,
fnd_responsibility_vl frv
WHERE frgu.request_unit_type = 'P'
AND frgu.request_group_id = frg.request_group_id
AND frgu.request_unit_id = fcpv.concurrent_program_id
AND frv.request_group_id = frg.request_group_id
ORDER BY responsibility_name;

11) Query to get all request with application
SELECT fa.application_short_name,
fcpv.user_concurrent_program_name,
description,
DECODE (fcpv.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',
fcpv.execution_method_code
) exe_method,
output_file_type, program_type, printer_name,
minimum_width,
minimum_length, concurrent_program_name,
concurrent_program_id
FROM fnd_concurrent_programs_vl fcpv, fnd_application fa
WHERE fcpv.application_id = fa.application_id
ORDER BY description

12) Query to Count Module Wise Report
SELECT fa.application_short_name,
DECODE (fcpv.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',
fcpv.execution_method_code
) exe_method,
COUNT (concurrent_program_id) COUNT
FROM fnd_concurrent_programs_vl fcpv, fnd_application fa
WHERE fcpv.application_id = fa.application_id
GROUP BY fa.application_short_name, fcpv.execution_method_code
ORDER BY 1;

13) Query to calculate request time
SELECT f.request_id , pt.user_concurrent_program_name user_concurrent_program_name
, f.actual_start_date actual_start_date
, f.actual_completion_date actual_completion_date,
floor(((f.actual_completion_date-f.actual_start_date)*24*60*60)/3600)
' HOURS '
floor((((f.actual_completion_date-f.actual_start_date)*24*60*60) -
floor(((f.actual_completion_date-f.actual_start_date)*24*60*60)/3600)*3600)/60)
' MINUTES '
round((((f.actual_completion_date-f.actual_start_date)*24*60*60) -
floor(((f.actual_completion_date-f.actual_start_date)*24*60*60)/3600)*3600 -
(floor((((f.actual_completion_date-f.actual_start_date)*24*60*60) -
floor(((f.actual_completion_date-f.actual_start_date)*24*60*60)/3600)*3600)/60)*60) ))
' SECS ' time_difference,
DECODE(p.concurrent_program_name,'ALECDC',p.concurrent_program_name'['f.descriptio
n']',p.concurrent_program_name) concurrent_program_name
, decode(f.phase_code,'R','Running','C','Complete',f.phase_code) Phase
, f.status_code
FROM apps.fnd_concurrent_programs p
, apps.fnd_concurrent_programs_tl pt
, apps.fnd_concurrent_requests f
WHERE f.concurrent_program_id = p.concurrent_program_id
and f.program_application_id = p.application_id
and f.concurrent_program_id = pt.concurrent_program_id
and f.program_application_id = pt.application_id
AND pt.language = USERENV('Lang')
and f.actual_start_date is not null
ORDER by f.actual_completion_date-f.actual_start_date desc;

14) Query to check responsibility assigned to a specific USER
SELECT UNIQUE u.user_id, SUBSTR (u.user_name, 1, 30) user_name,
SUBSTR (r.responsibility_name, 1, 60) responsiblity,
SUBSTR (a.application_name, 1, 50) application
FROM fnd_user u,
fnd_user_resp_groups g,
fnd_application_tl a,
fnd_responsibility_tl r
WHERE g.user_id(+) = u.user_id
AND g.responsibility_application_id = a.application_id
AND a.application_id = r.application_id
AND g.responsibility_id = r.responsibility_id
and a.application_name = 'Purchasing'
ORDER BY SUBSTR (user_name, 1, 30),
SUBSTR (a.application_name, 1, 50),
SUBSTR (r.responsibility_name, 1, 60);

15) Query to check Current Applied Patch
SELECT patch_name, patch_type, maint_pack_level, creation_date
FROM applsys.ad_applied_patches
ORDER BY creation_date DESC;

16) Query for Warning users for Apache bounce.
SELECT ppx.full_name
,fu.user_name
,nvl(ppx.email_address
,fu.email_address) AS email_address
FROM per_people_x ppx, fnd_user fu, fnd_logins fl
WHERE fl.start_time > SYSDATE - 2
AND fu.user_id = fl.user_id
AND ppx.person_id(+) = fu.employee_id
AND fu.user_name NOT IN ('INTERFACE', 'SYSADMIN', 'GUEST')
AND fu.user_name != 'PASSIA' --exclude anil
GROUP BY ppx.full_name
,fu.user_name
,nvl(ppx.email_address
,fu.email_address)
ORDER BY 2;

17) Query to Get instance ID of server.
SELECT NVL (LPAD (profile_option_value, 4, '0'), '0000')
FROM fnd_profile_option_values
WHERE application_id = 1
AND profile_option_id =
(SELECT profile_option_id
FROM fnd_profile_options
WHERE profile_option_name = 'NCR_ERP_INSTANCE_IDENTIFIER');

18) Query to get Concurrent program name and its parameter.

SELECT fcpl.user_concurrent_program_name ,
fcp.concurrent_program_name ,
par.end_user_column_name ,
par.form_left_prompt prompt ,
par.enabled_flag , par.required_flag ,
par.display_flag
FROM
fnd_concurrent_programs fcp ,
fnd_concurrent_programs_tl fcpl ,
fnd_descr_flex_col_usage_vl par
WHERE fcp.concurrent_program_id = fcpl.concurrent_program_id
AND fcpl.user_concurrent_program_name = &conc_prg_name
AND fcpl.LANGUAGE = 'US'
AND par.descriptive_flexfield_name = '$SRS$.' fcp.concurrent_program_name

19) Query to get all the active sessions.
select s.sid
--, s.serial#
, s.inst_id
, to_char(logon_time ,'mm/dd hh24:mi:ss') lt,
s.username, s.osuser
-- , p.spid
, s.program
, s.machine
, s.module
, s.action
, s.status
, s.*
from gv$session s
--, gv$process p
where
s.username is not null
and s.status = 'ACTIVE'
--order by 3 '
--and (s.module like '%MSC%' or s.module like 'MRP%' or s.module like 'MSR%')
--and s.program like 'BMCC%'
-- and s.module like '%NCR%'
--and s.module like 'INCOIN%'
and s.module like 'ITEMLOAD%'
order by 3

20) Query to get Sql statement running for any locked Program.

select /*+ ORDERED */
sql_text
-- , s.*
from gv$session s, gv$sqltext t
where t.address = s.sql_address
and s.inst_id = t.inst_id
and s.sid = &sid
and s.inst_id = &inst
order by s.inst_id, t.piece
/

OA Framework Issue.

Issue 1:
oracle.apps.fnd.framework.OAException: Application: FND, Message Name: FND_NO_REGION_DATA. Tokens: REGIONCODE = /oracle/apps/ncrx/xmlpublisher/server/EmpPG; at oracle.apps.fnd.framework.webui.JRAD2AKMapper.getRootMElement(JRAD2AKMapper.java:529) at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanTypeDataFromJRAD(OAWebBeanFactoryImpl.java:3719) at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getRootApplicationModuleClass(OAWebBeanFactoryImpl.java:3452) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1006) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430) at _oa__html._OA._jspService(_OA.java:84) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267) at oracle.jsp.JspServlet.internalService(JspServlet.java:186) at oracle.jsp.JspServlet.service(JspServlet.java:156) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162) at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187) at _oa__html._RF._jspService(_RF.java:102) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267) at oracle.jsp.JspServlet.internalService(JspServlet.java:186) at oracle.jsp.JspServlet.service(JspServlet.java:156) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456) at org.apache.jserv.JServConnection.run(JServConnection.java:294) at java.lang.Thread.run(Thread.java:619)## Detail 0 ## Exception: oracle.adf.mds.MetadataDefException: Unable to find component with absolute reference = /oracle/apps/ncrx/xmlpublisher/server/EmpPG, XML Path = null. Please verify that the reference is valid and the definition of the component exists either on the File System or in the MDS Repository. at oracle.adf.mds.internal.MetadataManagerBase.findElement(MetadataManagerBase.java:1350) at oracle.adf.mds.MElement.findElement(MElement.java:97) at oracle.apps.fnd.framework.webui.JRAD2AKMapper.getRootMElement(JRAD2AKMapper.java:503) at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanTypeDataFromJRAD(OAWebBeanFactoryImpl.java:3719) at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getRootApplicationModuleClass(OAWebBeanFactoryImpl.java:3452) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1006) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430) at _oa__html._OA._jspService(_OA.java:84) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267) at oracle.jsp.JspServlet.internalService(JspServlet.java:186) at oracle.jsp.JspServlet.service(JspServlet.java:156) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162) at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187) at _oa__html._RF._jspService(_RF.java:102) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267) at oracle.jsp.JspServlet.internalService(JspServlet.java:186) at oracle.jsp.JspServlet.service(JspServlet.java:156) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456) at org.apache.jserv.JServConnection.run(JServConnection.java:294) at java.lang.Thread.run(Thread.java:619) Exception: oracle.adf.mds.MetadataDefException: Unable to find component with absolute reference = /oracle/apps/ncrx/xmlpublisher/server/EmpPG, XML Path = null. Please verify that the reference is valid and the definition of the component exists either on the File System or in the MDS Repository. at oracle.adf.mds.internal.MetadataManagerBase.findElement(MetadataManagerBase.java:1350) at oracle.adf.mds.MElement.findElement(MElement.java:97) at oracle.apps.fnd.framework.webui.JRAD2AKMapper.getRootMElement(JRAD2AKMapper.java:503) at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getWebBeanTypeDataFromJRAD(OAWebBeanFactoryImpl.java:3719) at oracle.apps.fnd.framework.webui.OAWebBeanFactoryImpl.getRootApplicationModuleClass(OAWebBeanFactoryImpl.java:3452) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1006) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:509) at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:430) at _oa__html._OA._jspService(_OA.java:84) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267) at oracle.jsp.JspServlet.internalService(JspServlet.java:186) at oracle.jsp.JspServlet.service(JspServlet.java:156) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at oracle.jsp.provider.Jsp20RequestDispatcher.forward(Jsp20RequestDispatcher.java:162) at oracle.jsp.runtime.OraclePageContext.forward(OraclePageContext.java:187) at _oa__html._RF._jspService(_RF.java:102) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:119) at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java:417) at oracle.jsp.JspServlet.doDispatch(JspServlet.java:267) at oracle.jsp.JspServlet.internalService(JspServlet.java:186) at oracle.jsp.JspServlet.service(JspServlet.java:156) at javax.servlet.http.HttpServlet.service(HttpServlet.java:588) at org.apache.jserv.JServConnection.processRequest(JServConnection.java:456) at org.apache.jserv.JServConnection.run(JServConnection.java:294) at java.lang.Thread.run(Thread.java:619)

Solution: The Page not found on the server. Please check the path or check how you are running the Import command.

Issue 2: Wrongly assigned responsibility key to user in ERP.
Exception Details. oracle.apps.fnd.framework.OAException: Application: ICX, Message Name: Could not find the specified responsibility. (Could not lookup message because there is no database connection) at oracle.apps.fnd.framework.CreateIcxSession.getEncryptedSessId(CreateIcxSession.java:158) at oracle.apps.fnd.framework.CreateIcxSession.createSession(CreateIcxSession.java:80) at _test__fwktutorial._jspService(test_fwktutorial.jsp:45) at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java:139) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379) at javax.servlet.http.HttpServlet.service(HttpServlet.java:853) at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727) at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306) at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259) at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106) at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:797) at java.lang.Thread.run(Thread.java:534)

Solution: Please check the responsibility key and username. somehow it has been wrongly assigned.

Issue 3:

page error out -Error
You are trying to access a page that is no longer active.
- The referring page may have come from a previous session. Please select Home to proceed.
All Framework Pages should have a Function defined on the page when MAC Lite is enabled and the URL MAC Check fails.

Solution: This come generally when session got inactive.
Please navigate to project settings --> Runner --> JAVA options

-Xbootclasspath/p:\HOME\jdevbin\jdev\appslibrt\ojdbc14.jar;D:\HOME\jdevbin\jdev\appslibrt\nls_charset12.zip -DFND_JDBC_STMT_CACHE_SIZE=1000 -DCACHENODBINIT=true -DRUN_FROM_JDEV=true -mx256m

Increase the size of value DFND_JDBC_STMT_CACHE_SIZE to 5000.