Monday, January 27, 2014

Workflow Agent Listener Service WF_DEFERRED Will Not Start, Mailer May Be Down

To implement the solution, please execute the following steps:

1.  Use this query to identify any remaining items in wf_deferred queue:

SQL> select corrid,
decode(state,
0, '0 = Ready',
1, '1 = Delayed',
2, '2 = Retained',
3, '3 = Exception',
to_char(state)) State,
count(*) COUNT
from wf_deferred
group by corrid, state;


2. Items with the APPS corrid will not dequeue from agent listener via service container.  This runs the deferred listener from the command line. Make sure that the listener and workflow service components - including the mailer - are down before you run this. This is not intended to be a substitute for the normal operation of this service container from the OAM console. Use this only during this cleanup operation.

One will have to run this script manually:

begin
wf_log_pkg.wf_debug_flag := TRUE;
wf_event.listen('WF_DEFERRED');
end;
/
commit;

3.  Monitor the WF_DEFERRED queue. The events should move from 'ready' state to 'retained'.  Once they are in 'retained' status then the AQ time manager will automatically clean them off.

4. Use the OAM / workflow manager throughput / agent activity page to see if your events are enqueued into WF_NOTIFICATION_OUT queue.

NOTE:  Not all wf_deferred events are notification.send events so one may not have the same number of outbound mail messages as one had in wf_deferred.

5. Events can be cleaned off of WF_NOTIFICATION_OUT queue and rebuilt from the WF_NOTIFICATIONS table using the script wfntfqup.sql:

REBUILD THE WF_NOTIFICATION_OUT QUEUE

STEP 1. Stop the mailer, listeners and service component container in that order.

STEP 2. Run $FND_TOP/sql/wfntfqup.sql:

sqlplus apps/<apps_passwd> @$FND_TOP/patch/115/sql/wfntfqup apps <apps_passwd>
applsys

This job purges the wf_notification_out outbound message queue and repopulates from the
WF_NOTIFICATION table:

STEP 3. Ensure that this index is in place:

SQL> select index_name,column_name,column_position
from dba_ind_columns
where table_name='WF_NOTIFICATION_OUT' and
table_owner='APPLSYS'
> WF_NOTIFICATION_OUT_N1 CORRID

If it's not there one can add it back using $FND_TOP/sql/wfqidxc.sql. First check to see if
$FND_TOP/patch/115/sql/wfqidxc2.sql is present and if yes use that instead.


STEP 4. Restart the container, listeners and mailer in that order to test.
++++++ (Doc ID 958178.1) ++++++

Thursday, January 2, 2014

Autoconfig Failed with Error: FsCtxFileException: Start of Root Element Expected (Doc ID 876806.1)

On Oracle Applications 11.5.10.2, when attempting to run autoconfig the following error occurs.


Action to be taken : Copy the Data Base Context onto the file system
Result : Download of Context file failed

StackTrace:
java.lang.Exception: java.lang.Exception: oracle.apps.ad.autoconfig.oam.FsCtxFileException: Start of root element expected.
at oracle.apps.ad.tools.configuration.FileSysDBCtxMerge.updateFileSysContext(FileSysDBCtxMerge.java:655)
at oracle.apps.ad.tools.configuration.FileSysDBCtxMerge.updateFileSysFiles(FileSysDBCtxMerge.java:206)
at oracle.apps.ad.context.CtxValueMgt.mergeCustomInFiles(CtxValueMgt.java:1763)
at oracle.apps.ad.context.CtxValueMgt.processCtxFile(CtxValueMgt.java:1579)
at oracle.apps.ad.context.CtxValueMgt.main(CtxValueMgt.java:709)

ERROR: Context Value Management Failed.
Terminate.

CAUSE

The issue is caused by invalid data or corruption in the fnd_oam_context_files table

SOLUTION

To implement the solution, please execute the following steps:

1. Connect to SQL*PLUS as "APPLSYS" user.
(The "APPLSYS" password is always the same as the "APPS" user.)

2. Backup the FND_OAM_CONTEXT_FILES table, for example:

SQL> CREATE TABLE fnd_oam_context_files_bak
AS SELECT * FROM fnd_oam_context_files;

3. Truncate the FND_OAM_CONTEXT_FILES table, for example:

TRUNCATE TABLE fnd_oam_context_files;


4. Re-run Autoconfig on all nodes to repopulate the data.

Migrate AOL objects from one environment to another environment using FNDLOAD:


The Generic Loader (FNDLOAD) is a concurrent program that can transfer Oracle Application entity data between database and text file. The loader reads a configuration file to determine which entity to access. In simple words FNDLOAD is used to transfer entity data from one instance/database to other. For example if you want to move a concurrent program/menu/value sets developed in DEVELOPMENT instance to PRODUCTION instance you can use this command.

To FNDLOAD Concurrent Programs

FNDLOAD apps/$CLIENT_APPS_PWD O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CUSTOM_ORACLE_INTERFACE_PROG.ldt PROGRAM APPLICATION_SHORT_NAME="XXGMS" CONCURRENT_PROGRAM_NAME="XX_CUSTOM_ORACLE_INTERFACE_PROG"
##Note that
##---------
## XXGMS will be your custom GMS Application Shortname where concurrent program is registered
## XX_CUSTOM_ORACLE_INTERFACE_PROG
Will be the name of your request group
## XX_CUSTOM_ORACLE_INTERFACE_PROG.ldt is the file where concurrent program definition will be extracted
## ##To upload
FNDLOAD apps/$CLIENT_APPS_PWD O Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct XX_CUSTOM_ORACLE_INTERFACE_PROG.ldt

To FNDLOAD Request sets with stages

## For this you will be firstly required to download the request set definition.
## Next you will be required to download the Sets Linkage definition
## Well, lets be clear here, the above sequence is more important while uploading
FNDLOAD apps/$CLIENT_APPS_PWD 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct XX_GL_MY_INTERFACE_SET.ldt REQ_SET REQUEST_SET_NAME="FNDRSSUB4610101_Will_look_like_this"
FNDLOAD apps/$CLIENT_APPS_PWD 0 Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct XX_GL_MY_INTERFACE_SET_LINK.ldt REQ_SET_LINKS REQUEST_SET_NAME="FNDRSSUB4610101_Will_look_like_this"
## Note that FNDRSSUB4610101 can be found by doing an examine on the
########----->select request_set_name from fnd_request_sets_vl
########----->where user_request_set_name = 'User visible name for the request set here'
## Now for uploading the request set, execute the below commands
FNDLOAD apps/$CLIENT_APPS_PWD 0 Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct XX_GL_MY_INTERFACE_SET.ldt
FNDLOAD apps/$CLIENT_APPS_PWD 0 Y UPLOAD $FND_TOP/patch/115/import/afcprset.lct XX_GL_MY_INTERFACE_SET_LINK.ldt

To FNDLOAD Request groups

FNDLOAD apps/$CLIENT_APPS_PWD O Y DOWNLOAD $FND_TOP/patch/115/import/afcpreqg.lct XX_MY_REPORT_GROUP_NAME.ldt REQUEST_GROUP REQUEST_GROUP_NAME="XX_MY_REPORT_GROUP_NAME" APPLICATION_SHORT_NAME="XXGMS"
##Note that
##---------
## <> will be your Application Shortname where request group is registered
## XX_MY_REPORT_GROUP_NAME
Will be the name of your request group
## ##To upload this Request Group in other environment after having transferred the ldt file

FNDLOAD apps/$CLIENT_APPS_PWD O Y UPLOAD $FND_TOP/patch/115/import/afcpreqg.lct

To FNDLOAD responsibility

FNDLOAD apps/$CLIENT_APPS_PWD O Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct XX_PERSON_RESPY.ldt FND_RESPONSIBILITY RESP_KEY="XX_PERSON_RESPY"
## note that XX_PERSON_RESPY is the responsibility key
## Now to upload
FNDLOAD apps/$CLIENT_APPS_PWD O Y UPLOAD $FND_TOP/patch/115/import/afscursp.lct XX_PERSON_RESPY.ldt

To FNDLOAD Profile options

FNDLOAD apps/$CLIENT_APPS_PWD O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct POR_ENABLE_REQ_HEADER_CUST.ldt PROFILE PROFILE_NAME="POR_ENABLE_REQ_HEADER_CUST" APPLICATION_SHORT_NAME="ICX"
## Note that
## POR_ENABLE_REQ_HEADER_CUST is the short name of profile option
## We aren't passing the user profile option name in this case. Validate using ...
########----->select application_id, PROFILE_OPTION_NAME || '==>' || profile_option_id || '==>' ||
########----->USER_PROFILE_OPTION_NAME
########----->from FND_PROFILE_OPTIONS_VL
########----->where PROFILE_OPTION_NAME like '%' || upper('&profile_option_name') || '%'
########----->order by PROFILE_OPTION_NAME
########----->/
## Now to upload
FNDLOAD apps/$CLIENT_APPS_PWD O Y UPLOAD $FND_TOP/patch/115/import/afscprof.lct POR_ENABLE_REQ_HEADER_CUST.ldt

To FNDLOAD User definitions

FNDLOAD apps/$CLIENT_APPS_PWD 0 Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct ./XX_FND_USER_PASSI.ldt FND_USER USER_NAME='GANESH'
#Do not worry about your password being extracted, it will be encrypted as below in ldt file
#BEGIN FND_USER "GANESH"
# OWNER = "GEMBALI"
# LAST_UPDATE_DATE = "2007/06/12"
# ENCRYPTED_USER_PASSWORD = "ZGE45A8A9BE5CF4339596C625B99CAEDF136C34FEA244DC7A"
# SESSION_NUMBER = "0"To upload the FND_USER using FNDLOAD command use
FNDLOAD apps/$CLIENT_APPS_PWD 0 Y UPLOAD $FND_TOP/patch/115/import/afscursp.lct ./XX_FND_USER_PASSI.ldt
Notes for using FNDLOAD against FND_USER:-
1. After uploading using FNDLOAD, user will be promoted to change their password again during their next signon attempt.
2. All the responsibilities will be extracted by FNDLOAD alongwith User Definition in FND_USER
3. In the Target Environment , make sure that you have done FNDLOAD for new responsibilities prior to running FNDLOAD on users.

Notes :

1. Give special attention when downloading Menus or Responsibilities.
In case your client has several developers modifying Responsibilities and Menus, then be ultra carefull. Not being carefull will mean that untested Forms and Functions will become available in your clients Production environment besides your tested forms, functions and menus.
2. Be very careful when downloading flexfields that reference value sets with independent values for GL Segment Codes.
By doing so, you will download and extract all the test data in GL Codes that might not be applicable for production.
3. There are several variations possible for FNDLOAD, for example you can restrict the download and uploads to specific segments within Descriptive Flex Fields. Please amend the above examples as desired for applying appropriate filterations.
4. The list of examples by no mean cover all possible FNDLOAD entities.
5. FNDLOAD is very reliable and stable, if used properly. This happens to by one of my favourite Oracle utilities.
6. Last but not the least, please test your FNDLOAD properly, so as to ensure that you do not get any unexpected data. In past I have noticed undesired results when the Lookup gets modified manually directly on production, and then the FNDLOAD is run for similar changes. If possible, try to follow a good practice of modifying FNDLOADable data only by FNDLOAD on production environment.
7. As the name suggests, FNDLOAD is useful for FND Related objects. However in any implementation, you will be required to migrate the Setups in Financials and Oracle HRMS from one environment to another. For this you can use iSetup. "Oracle iSetup".
Some of the things that can be migrated using Oracle iSetup are
GL Set of Books, HR Organization Structures, HRMS Employees, Profile Options Setup, Suppliers, Customers, Tax Codes & Tax Rates, Financials Setup, Accounting Calendars, Chart of Accounts, GL Currencies.