Wednesday, May 1, 2013

Concurrent Request Scripts


Concurrent Request Scripts

****HISTORY OF CONCURRENT REQUEST - SCRIPT (PROGRAM WISE) *****

set pagesize 200
set linesize 200
col "Who submitted" for a25
col "Status" for a10
col "Parameters" for a20
col USER_CONCURRENT_PROGRAM_NAME for a42
SELECT distinct t.user_concurrent_program_name,
r.REQUEST_ID,
to_char(r.ACTUAL_START_DATE,'dd-mm-yy hh24:mi:ss') "Started at",
to_char(r.ACTUAL_COMPLETION_DATE,'dd-mm-yy hh24:mi:ss') "Completed at",
decode(r.PHASE_CODE,'C','Completed','I','Inactive','P ','Pending','R','Running','NA') phasecode,
decode(r.STATUS_CODE, 'A','Waiting', 'B','Resuming', 'C','Normal', 'D','Cancelled', 'E','Error', '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') "Status",r.argument_text "Parameters",substr(u.description,1,25) "Who submitted",round(((nvl(v.actual_completion_date,sysdate)-v.actual_start_date)*24*60)) Etime
FROM
apps.fnd_concurrent_requests r ,
apps.fnd_concurrent_programs p ,
apps.fnd_concurrent_programs_tl t,
apps.fnd_user u, apps.fnd_conc_req_summary_v v
WHERE
r.CONCURRENT_PROGRAM_ID = p.CONCURRENT_PROGRAM_ID
AND r.actual_start_date >= (sysdate-30)
--AND r.requested_by=22378
AND   r.PROGRAM_APPLICATION_ID = p.APPLICATION_ID
AND t.concurrent_program_id=r.concurrent_program_id
AND r.REQUESTED_BY=u.user_id
AND v.request_id=r.request_id
--AND r.request_id ='2260046' in ('13829387','13850423')
and t.user_concurrent_program_name like '%%'
order by to_char(r.ACTUAL_COMPLETION_DATE,'dd-mm-yy hh24:mi:ss');


 *** Requests completion date details ***

SELECT request_id, TO_CHAR( request_date, 'DD-MON-YYYY HH24:MI:SS' )
request_date, TO_CHAR( requested_start_date,'DD-MON-YYYY HH24:MI:SS' )
requested_start_date, TO_CHAR( actual_start_date, 'DD-MON-YYYY HH24:MI:SS' )
actual_start_date, TO_CHAR( actual_completion_date, 'DD-MON-YYYY HH24:MI:SS' )
actual_completion_date, TO_CHAR( sysdate, 'DD-MON-YYYY HH24:MI:SS' )
current_date, ROUND( ( NVL( actual_completion_date, sysdate ) - actual_start_date ) * 24, 2 ) duration
FROM fnd_concurrent_requests
WHERE request_id = TO_NUMBER('&p_request_id');

*** Reqid_from sid **

SELECT a.request_id, a.PHASE_CODE, a.STATUS_CODE,
d.sid as Oracle_SID,
d.serial#,
d.osuser,
d.process,
c.SPID as OS_Process_ID
FROM apps.fnd_concurrent_requests a,
apps.fnd_concurrent_processes b,
gv$process c,
gv$session d
WHERE a.controlling_manager = b.concurrent_process_id
AND c.pid = b.oracle_process_id
AND b.session_id=d.audsid AND a.PHASE_CODE='R' AND a.STATUS_CODE='R'
AND d.sid = &SID;

How to Determine Which Manager Ran a Specific Concurrent Request?

col USER_CONCURRENT_QUEUE_NAME for a100
select b.USER_CONCURRENT_QUEUE_NAME from fnd_concurrent_processes a,
fnd_concurrent_queues_vl b, fnd_concurrent_requests c
where a.CONCURRENT_QUEUE_ID = b.CONCURRENT_QUEUE_ID
and a.CONCURRENT_PROCESS_ID = c.controlling_manager
and c.request_id = '&conc_reqid';


Concurrent request status for a given sid?

col MODULE for a20
col OSUSER for a10
col USERNAME for a10
set num 10
col MACHINE for a20
set lines 200
col SCHEMANAME for a10
select s.INST_ID,s.sid,s.serial#,p.spid os_pid,s.status, s.osuser,s.username, s.MACHINE,s.MODULE, s.SCHEMANAME,
s.action from gv$session s, gv$process p WHERE s.paddr = p.addr and s.sid = '&oracle_sid';


Find out request id from Oracle_Process Id:

select REQUEST_ID,ORACLE_PROCESS_ID,OS_PROCESS_Id from apps.fnd_concurrent_requests where ORACLE_PROCESS_ID='&a';

To find concurrent program name,phase code,status code for a given request id?

SELECT request_id, user_concurrent_program_name, DECODE(phase_code,'C','Completed',phase_code) phase_code, DECODE(status_code,'D', 'Cancelled' ,
'E', 'Error' , 'G', 'Warning', 'H','On Hold' , 'T', 'Terminating', 'M', 'No Manager' , 'X', 'Terminated',  'C', 'Normal', status_code) status_code, to_char(actual_start_date,'dd-mon-yy:hh24:mi:ss') Start_Date, to_char(actual_completion_date,'dd-mon-yy:hh24:mi:ss'), completion_text FROM apps.fnd_conc_req_summary_v WHERE request_id = '&req_id' ORDER BY 6 DESC;

To find the sql query for a given concurrent request sid?

select sid,sql_text from gv$session ses, gv$sqlarea sql where
ses.sql_hash_value = sql.hash_value(+) and ses.sql_address = sql.address(+) and ses.sid='&oracle_sid'
/

To find child requests for Parent request id.

set lines 200
col USER_CONCURRENT_PROGRAM_NAME for a40
col PHASE_CODE for a10
col STATUS_CODE for a10
col COMPLETION_TEXT for a20
SELECT sum.request_id,req.PARENT_REQUEST_ID,sum.user_concurrent_program_name, DECODE(sum.phase_code,'C','Completed',sum.phase_code) phase_code, DECODE(sum.status_code,'D', 'Cancelled' ,
'E', 'Error' , 'G', 'Warning', 'H','On Hold' , 'T', 'Terminating', 'M', 'No Manager' , 'X', 'Terminated',  'C', 'Normal', sum.status_code) status_code, sum.actual_start_date, sum.actual_completion_date, sum.completion_text FROM apps.fnd_conc_req_summary_v sum, apps.fnd_concurrent_requests req where  req.request_id=sum.request_id and req.PARENT_REQUEST_ID = '&parent_concurrent_request_id';


set col os_process_id for 99
select HAS_SUB_REQUEST, is_SUB_REQUEST, parent_request_id, ORACLE_PROCESS_ID, ORACLE_SESSION_ID, OS_PROCESS_ID from fnd_concurrent_requests where request_id= '&Req_ID' ;


Cancelling Concurrent request :

--By request id
update fnd_concurrent_requests
set status_code='D', phase_code='C'
where request_id=&req_id;

--by program_id
update fnd_concurrent_requests
set status_code='D', phase_code='C'
where CONCURRENT_PROGRAM_ID=&prg_id;

To terminate the all concurrent requests using by Module wise.

select 'ALTER SYSTEM KILL SESSION '''||sid||','||serial#||''' immediate;' from gv$session where MODULE like 'GLPREV';

History of concurrent requests which are error out

SELECT a.request_id "Req Id"
,a.phase_code,a.status_code
, actual_start_date
, actual_completion_date
,c.concurrent_program_name || ': ' || ctl.user_concurrent_program_name "program"
FROM APPLSYS.fnd_Concurrent_requests a,APPLSYS.fnd_concurrent_processes b
,applsys.fnd_concurrent_queues q
,APPLSYS.fnd_concurrent_programs c
,APPLSYS.fnd_concurrent_programs_tl ctl
WHERE a.controlling_manager = b.concurrent_process_id
AND a.concurrent_program_id = c.concurrent_program_id
AND a.program_application_id = c.application_id
AND a.status_code = 'E'
AND a.phase_code = 'C'
AND actual_start_date > sysdate - 2
AND b.queue_application_id = q.application_id
AND b.concurrent_queue_id = q.concurrent_queue_id
AND ctl.concurrent_program_id = c.concurrent_program_id
AND ctl.LANGUAGE = 'US'
ORDER BY 5 DESC;

***** Find out Concurrent Program which enable with trace****

col User_Program_Name for a40
col Last_Updated_By for a30
col DESCRIPTION for a30
SELECT A.CONCURRENT_PROGRAM_NAME "Program_Name",
SUBSTR(A.USER_CONCURRENT_PROGRAM_NAME,1,40) "User_Program_Name",
SUBSTR(B.USER_NAME,1,15) "Last_Updated_By",
SUBSTR(B.DESCRIPTION,1,25) DESCRIPTION
FROM APPS.FND_CONCURRENT_PROGRAMS_VL A, APPLSYS.FND_USER B
WHERE A.ENABLE_TRACE='Y'
AND A.LAST_UPDATED_BY=B.USER_ID;


***Concurrent Program count under QUEUE ***

col  "program name" format a55;
col "name" format  a17;
col "queue name" format a15
col "statuscode" format a3
select user_CONCURRENT_PROGRAM_NAME "PROGRAM NAME",concurrent_queue_name "QUEUE NAME", priority,decode(phase_code,'P','Pending') "PHASE",
decode(status_code,'A','Waiting','B','Resuming','C','Normal','D','Cancelled','E','Error','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') "
NAME", status_code,count(*) from
fnd_concurrent_worker_requests
where  phase_code='P' and hold_flag!='Y'
and requested_start_date<=sysdate
and concurrent_queue_name<> 'FNDCRM'
and concurrent_queue_name<> 'GEMSPS'
group by
user_CONCURRENT_PROGRAM_NAME,
concurrent_queue_name,priority,phase_code,status_code
order by count(*) desc
/

***Lists the Manager Names with the No. of Requests in Pending/Running ***

col "USER_CONCURRENT_QUEUE_NAME" format a40;

SELECT a.USER_CONCURRENT_QUEUE_NAME,a.MAX_PROCESSES,
sum(decode(b.PHASE_CODE,'P',decode(b.STATUS_CODE,'Q',1,0),0)) Pending_Standby,
sum(decode(b.PHASE_CODE,'P',decode(b.STATUS_CODE,'I',1,0),0)) Pending_Normal,
sum(decode(b.PHASE_CODE,'R',decode(b.STATUS_CODE,'R',1,0),0)) Running_Normal
FROM FND_CONCURRENT_QUEUES_VL a, FND_CONCURRENT_WORKER_REQUESTS b
where a.concurrent_queue_id = b.concurrent_queue_id
AND b.Requested_Start_Date<=SYSDATE
GROUP BY a.USER_CONCURRENT_QUEUE_NAME,a.MAX_PROCESSES;


*** Concurrent QUEUE Details ***


set echo off
set linesize 130
set serveroutput on size 50000
set feed off
set veri off
DECLARE
running_count NUMBER := 0;
pending_count NUMBER := 0;
crm_pend_count NUMBER := 0;
--get the list of all conc managers and max worker and running workers
CURSOR conc_que IS
SELECT concurrent_queue_id,
concurrent_queue_name,
user_concurrent_queue_name,
max_processes,
running_processes
FROM apps.fnd_concurrent_queues_vl
WHERE enabled_flag='Y' and
concurrent_queue_name not like 'XDP%' and
concurrent_queue_name not like 'IEU%' and
concurrent_queue_name not in ('ARTAXMGR','PASMGR') ;
BEGIN
DBMS_OUTPUT.PUT_LINE('====================================================================================================');
DBMS_OUTPUT.PUT_LINE('QueueID'||' '||'Queue          '||
'Concurrent Queue Name               '||' '||'MAX '||' '||'RUN '||' '||
'Running '||' '||'Pending   '||' '||'In CRM');
DBMS_OUTPUT.PUT_LINE('====================================================================================================');
FOR i IN conc_que
LOOP
--for each manager get the number of pending and running requests in each queue
SELECT /*+ RULE */ nvl(sum(decode(phase_code, 'R', 1, 0)), 0),
nvl(sum(decode(phase_code, 'P', 1, 0)), 0)
INTO running_count, pending_count
FROM fnd_concurrent_worker_requests
WHERE
requested_start_date <= sysdate
and concurrent_queue_id = i.concurrent_queue_id
AND hold_flag != 'Y';
--for each manager get the list of requests pending due to conflicts in each manager
SELECT /*+ RULE */ count(1)
INTO crm_pend_count
FROM apps.fnd_concurrent_worker_requests a
WHERE concurrent_queue_id = 4
AND hold_flag != 'Y'
AND requested_start_date <= sysdate
AND exists (
SELECT 'x'
FROM apps.fnd_concurrent_worker_requests b
WHERE a.request_id=b.request_id
and concurrent_queue_id = i.concurrent_queue_id
AND hold_flag != 'Y'
AND requested_start_date <= sysdate);
--print the output by joining the outputs of manager counts,
DBMS_OUTPUT.PUT_LINE(
rpad(i.concurrent_queue_id,8,'_')||
rpad(i.concurrent_queue_name,15, ' ')||
rpad(i.user_concurrent_queue_name,40,' ')||
rpad(i.max_processes,6,' ')||
rpad(i.running_processes,6,' ')||
rpad(running_count,10,' ')||
rpad(pending_count,10,' ')||
rpad(crm_pend_count,10,' '));
--DBMS_OUTPUT.PUT_LINE('----------------------------------------------------------------------------------------------------');
END LOOP;
DBMS_OUTPUT.PUT_LINE('====================================================================================================');
END;
/
set verify on
set echo on

Friday, April 26, 2013

WARNING: Heavy Swapping Observed On System In Last 5 Mins.After upgrade to 11.2.0.3


WARNING: Heavy Swapping Observed On System In Last 5 Mins.After upgrade to 11.2.0.3


Oracle Database - Enterprise Edition - Version 11.2.0.3 to 11.2.0.3 [Release 11.2]
Information in this document applies to any platform.
Goal

The document explains why you may see the following WARNING in the alert log after upgrading to 11.2.0.3.

Wed Apr 25 10:10:50 2012
WARNING: Heavy swapping observed on system in last 5 mins.
pct of memory swapped in [7.16%] pct of memory swapped out [0.56%].
Please make sure there is no memory pressure and the SGA and PGA
are configured correctly. Look at DBRM trace file for more details.
Fix

The reason you may now see these informational messages in the alert is due to the fact that in 11.2.0.3 an enhancement fix was included for unpublished
Bug 10220118 - Print warning to alert log when system is swapping (Doc ID 10220118.8)

Please refer to
Note 10220118.8 - Bug 10220118 - Print warning to alert log when system is swapping



Description

  This fix is really an enhancement.
  With this fix a warning is printed to the alert log (and DBRM trace)
  if excessive swapping is observed on the system.
  The warning will not be printed more than once per hour.
 

The same issues could have been happening on 11.2.0.2 but they simply would not have been reported.
There is no cause for concern and we suggest that the databases are just monitored as usual.

If you look in the alert log, you will see that the message does not happen every hour.
If SWAP was causing any serious issue we could also see ORA-4031/ORA-4030 and would then be able to use the DBRM trace in conjunction with obtaining further diagnostics.



- If your Platform is IBM-AIX then This is not the only reason for this alert log file. There is a known port-specific bug for IBM AIX on POWER Systems (64-bit):

Bug 14731911 : FALSE SWAP WARNING MESSAGES PRINTED TO ALERT.LOG ON AIX
Base Bug 11801934 : WRONG PAGE-IN AND PAGE-OUT OS VM STATS IN AIX.

Solution for AIX

Apply patch 11801934 if available for your platform or request a patch to Oracle Support in a new Service Request.



Wednesday, April 3, 2013

Fixing Duplicate Sales Order Transactions In MTI, MMTT and MMT



Inventory Standard Datafix Instruction #17: Fixing Duplicate Sales Order Transactions In MTI, MMTT and MMT

In this Document
Goal
Fix
          A - Identification Scripts.
          Identify
          Symptoms
          Symptom List
          B - Verifying your File Versions.
          C -  Root Cause Analysis.
          1. Duplicate Transactions After One In Batch Failed
          2. New Root- Causes?
          D - Datafix.
          1. Identify data.
          2. Backup data.
          3. Run the datafix script.
          4- Check the data.
References
Applies to:

Oracle Inventory Management - Version 11.5.10.2 and later
Information in this document applies to any platform.
Error occurred while relieving reservations: INV_RSV_RLF_FAILED


Goal



This document provides detailed instructions for removing duplicate sales order transactions between the various inventory transaction tables:  Transaction interface (MTL_TRANSACTIONS_INTERFACE MTI), pending transactions (MTL_MATERIAL_TRANSACTIONS_TEMP MMTT) and the transaction history (MTL_MATERIAL_TRANSACTIONS MMTT).  The scripts focus on sales orders and have no affect on inventory transactions like miscellaneous receipts or WIP transactions. Also this document will show all the available information regarding the Root Cause of this data corruption.

Please follow up this document in the following order:
A. Identification Scripts: This will confirm if you are having this data corruption.
B. Verifying your file versions: This will allow you and support to confirm if you are already in a known fixed version.
C. Root Cause Analysis. It shows all the relevant information about this issue Root Cause.
D. Datafix Intructions. It will provide steps for fixing the data corruption.

Fix

A - Identification Scripts.

Identify

Please run the identification script (INV17-ident.sql) uploaded into this document.

PROMPT
PROMPT INV17-ident.sql
PROMPT From Note:1472074.1 Inventory Standard Datafix Instruction #17:
PROMPT ... Fixing Duplicate Sales Order Transactions In MTI, MMTT and MMT
PROMPT The script is based on details in Bug 4286083.
PROMPT The sql identifies if the transactions are duplicate transactions
PROMPT in the inventory transactions tables. 
PROMPT The sql is ONLY valid for Order Management duplicate transactions
PROMPT and will NOT identifyother sources like WIP jobs or inventory aliases.
PROMPT

PROMPT a. MMT vs. MTI
PROMPT Count Duplicates Between Historical transactions (MMT) vs. Interface transactions (MTI)
SELECT count(*)
FROM mtl_material_transactions b, mtl_transactions_interface a
WHERE a.picking_line_id = b.picking_line_id
AND a.trx_source_line_id = b.trx_source_line_id
AND a.inventory_item_id = b.inventory_item_id
AND b.transaction_type_id = a.transaction_type_id
AND b.transaction_source_type_id in (2,8)
AND b.picking_line_id is not null ;

PROMPT b. MMTT vs. MTI
PROMPT Count Duplicates Between Pending transactions (MMTT) vs. Interface transactions (MTI)
SELECT count(*)
FROM mtl_material_transactions_temp b,  mtl_transactions_interface a
WHERE a.picking_line_id = b.picking_line_id
AND a.trx_source_line_id = b.trx_source_line_id
AND a.inventory_item_id = b.inventory_item_id
AND b.transaction_type_id = a.transaction_type_id
AND b.transaction_source_type_id in (2,8)
AND b.picking_line_id is not null ;

PROMPT c. MMT vs. MMTT:
PROMPT Count Duplicates Between Historical transactions (MMT) vs. Pending transactions (MMTT)
SELECT count(*)
FROM mtl_material_transactions b,  mtl_material_transactions_temp a
WHERE a.picking_line_id = b.picking_line_id
AND a.trx_source_line_id = b.trx_source_line_id
AND a.inventory_item_id = b.inventory_item_id
AND b.transaction_type_id = a.transaction_type_id
AND b.transaction_source_type_id in ( 2,8)
AND b.picking_line_id is not null;
Symptoms

The symptoms for this issue can be similar to Note:1471606.1 Inventory Standard Datafix Instruction #16: Fixing Stuck transaction with 'Error Occurred While Relieving Reservations'. In addition, you might find transactions preventing period close when the records are actually duplicates that can be deleted.

Symptom List

Here are some common observations, symptoms and errors that identify this issue.

Action Result
Close period   The period cannot close due to pending transactions.
Pick release   Pick release backorders line
Transact or allocate move order    
Transact or allocate fails. Receive an error:
The material sourcing process failed to create picking suggestions for line

View Material Workbench Available Quantity       Onhand quantity is MORE than available quantity but you have no current move orders or reservations.
Ship confirm  Onhand quantity is MORE than available quantity but you have no current move orders or reservations.
Ship confirm 
Ship confirm fails. Receive an error:
An error occurred while relieving reservations
(Code: INV_RSV_RLF_FAILED)



B - Verifying your File Versions.

Execute the following from your server for getting key file versions of the following files:

TrxProcessor.java
BaseTransaction.java
INVTXMGB.pls
INVTRXWB.pls

You can use SQL like the following:

set serveroutput on
PROMPT : - - - - : TrxProcessor.java : - - - - :
exec fnd_aolj_util.getClassVersionfromDB('oracle.apps.inv.transaction.server.TrxProcessor');

PROMPT : - - - - : BaseTransaction.java : - - - - :
exec fnd_aolj_util.getclassversionfromdb('oracle.apps.inv.transaction.server.BaseTransaction');

PROMPT : - - - - : INVTXMGB.pls : - - - - :
SELECT text FROM dba_source
 WHERE name = 'INV_TXN_MANAGER_PUB'
    AND line < 3;

PROMPT : - - - - : INVTRXWB.pls : - - - - :
SELECT text FROM dba_source
 WHERE name = 'INV_LPN_TRX_PUB'
    AND line < 3;
Or review the AppsCheck output from Note 276207.1 for application parameter: Inventory

C -  Root Cause Analysis.

The following Root Causes have been identified at this moment.

1. Duplicate Transactions After One In Batch Failed

While processing transactions through open interface, if batch id is populated and if the first row in a batch fails then the previous batch, which got successfully processed was not getting deleted from pending transactions table and open interface table.                                                         

Release         Bug     Patch  Filename       Version
R11.5.8         Bug 3024133  Patch 2640488         BaseTransaction.java          115.111.11580.5+
R11.5.10       Bug 5710072  Patch 5935177         BaseTransaction.java          115.235.115100.36+
R12.0.x         Bug 5748351  Patch 6728000:R12.0.6       TrxProcessor.java
BaseTransaction.java
INVTXMGB.pls
INVTRXWB.pls          120.10.12000000.4+
120.39.12000000.2+
120.25.12000000.3+
120.34.12000000.11+


2. New Root- Causes?

We are always looking for additional reasons for data issues. If you are on a higher version or can replicate the issue for a different situation, please log a service request.

IMPORTANT: If you are in higher file version please log a SR with Support Services or update the existing one providing this note number and the script output from section A and the file versions from section B and we will add your SR to the Internal Root Cause Analysis (RCA) Bug 8857390 for Release 12 and RCA Bug 9270328 for release 11i.

Also, if you are in higher file versions and you can replicate this issue, we would like to hear more on how you do it and then we can log a new bug focusing on fixing the issue. Please log a SR with Support Services or update the existing one with replication steps.



D - Datafix.

Follow the steps below to fix the data. The following temporary views are created to facilitate the backup table creation and the datafix. You can drop these views later if desired:

View   Explanation
mmt_mti_records_v  Compare the historical transactions to the interface transactions.
mmtt_mti_records_v Compare the pending transactions to the interface transactions.
mmt_mmtt_records_v        Compare the historical transactions to the pending transactions.


1. Identify data.

Please run the identification script (INV17-ident.sql) uploaded into this document.

2. Backup data.

Run the backup script (INV17-backup.sql). The backup script creates the following tables: mti_dup_backup, msni_dup_backup, mtli_dup_backup, mti_dup_backup_mmtt, msni_dup_backup_mmtt, mtli_dup_backup_mmtt, mmtt_dup_backup, msnt_dup_backup, mtlt_dup_backup

3. Run the datafix script.

Run the datafix script (INV17-datafix.sql) uploaded into the note. This will fix the data by removing duplicate transactions.

Note: The script DOES commit.
4- Check the data.

Check if your data has been corrected and you are not experiencing problems. You can rerun the script from the identification section:  (INV17-ident.sql) uploaded into this document.

Note: You may also need to submit any good, remaining transactions. For example, you could check for unprocessed records, resubmit any you can via the form, rerun the inventory manager, rerun trip stop, etc. See Note:1069492.1 Resolving Period Close Pending Transaction R12 that includes SQL to update transactions as well.

For example, this SQL could resubmit unprocessed pending transactions that you cannot see via the form because they are transaction mode 8:

update mtl_material_transactions_temp
 set process_flag = 'Y',
 lock_flag = 'N',
 transaction_mode = 3,
 error_code = NULL,
 error_explanation = NULL
where process_flag in ('Y','E')


References

NOTE:568012.1 - FAQ: Inventory Standard Datafixes
NOTE:280400.1 - Stuck Transaction Interface Sales Order Issues: An Error Occured While Relieving Reservations (INV_RSV_RLF_FAILED)
NOTE:294391.1 - What do the transaction mode (like transaction_mode = 8) numbers mean in the pending transactions table (MTL_MATERIAL_TRANSACTIONS_TEMP)?



Attachments


Fixing Duplicate Sales Order Transactions In MTI, MMTT and MMT



Inventory Standard Datafix Instruction #17: Fixing Duplicate Sales Order Transactions In MTI, MMTT and MMT

In this Document
Goal
Fix
          A - Identification Scripts.
          Identify
          Symptoms
          Symptom List
          B - Verifying your File Versions.
          C -  Root Cause Analysis.
          1. Duplicate Transactions After One In Batch Failed
          2. New Root- Causes?
          D - Datafix.
          1. Identify data.
          2. Backup data.
          3. Run the datafix script.
          4- Check the data.
References
Applies to:

Oracle Inventory Management - Version 11.5.10.2 and later
Information in this document applies to any platform.
Error occurred while relieving reservations: INV_RSV_RLF_FAILED


Goal



This document provides detailed instructions for removing duplicate sales order transactions between the various inventory transaction tables:  Transaction interface (MTL_TRANSACTIONS_INTERFACE MTI), pending transactions (MTL_MATERIAL_TRANSACTIONS_TEMP MMTT) and the transaction history (MTL_MATERIAL_TRANSACTIONS MMTT).  The scripts focus on sales orders and have no affect on inventory transactions like miscellaneous receipts or WIP transactions. Also this document will show all the available information regarding the Root Cause of this data corruption.

Please follow up this document in the following order:
A. Identification Scripts: This will confirm if you are having this data corruption.
B. Verifying your file versions: This will allow you and support to confirm if you are already in a known fixed version.
C. Root Cause Analysis. It shows all the relevant information about this issue Root Cause.
D. Datafix Intructions. It will provide steps for fixing the data corruption.

Fix

A - Identification Scripts.

Identify

Please run the identification script (INV17-ident.sql) uploaded into this document.

PROMPT
PROMPT INV17-ident.sql
PROMPT From Note:1472074.1 Inventory Standard Datafix Instruction #17:
PROMPT ... Fixing Duplicate Sales Order Transactions In MTI, MMTT and MMT
PROMPT The script is based on details in Bug 4286083.
PROMPT The sql identifies if the transactions are duplicate transactions
PROMPT in the inventory transactions tables. 
PROMPT The sql is ONLY valid for Order Management duplicate transactions
PROMPT and will NOT identifyother sources like WIP jobs or inventory aliases.
PROMPT

PROMPT a. MMT vs. MTI
PROMPT Count Duplicates Between Historical transactions (MMT) vs. Interface transactions (MTI)
SELECT count(*)
FROM mtl_material_transactions b, mtl_transactions_interface a
WHERE a.picking_line_id = b.picking_line_id
AND a.trx_source_line_id = b.trx_source_line_id
AND a.inventory_item_id = b.inventory_item_id
AND b.transaction_type_id = a.transaction_type_id
AND b.transaction_source_type_id in (2,8)
AND b.picking_line_id is not null ;

PROMPT b. MMTT vs. MTI
PROMPT Count Duplicates Between Pending transactions (MMTT) vs. Interface transactions (MTI)
SELECT count(*)
FROM mtl_material_transactions_temp b,  mtl_transactions_interface a
WHERE a.picking_line_id = b.picking_line_id
AND a.trx_source_line_id = b.trx_source_line_id
AND a.inventory_item_id = b.inventory_item_id
AND b.transaction_type_id = a.transaction_type_id
AND b.transaction_source_type_id in (2,8)
AND b.picking_line_id is not null ;

PROMPT c. MMT vs. MMTT:
PROMPT Count Duplicates Between Historical transactions (MMT) vs. Pending transactions (MMTT)
SELECT count(*)
FROM mtl_material_transactions b,  mtl_material_transactions_temp a
WHERE a.picking_line_id = b.picking_line_id
AND a.trx_source_line_id = b.trx_source_line_id
AND a.inventory_item_id = b.inventory_item_id
AND b.transaction_type_id = a.transaction_type_id
AND b.transaction_source_type_id in ( 2,8)
AND b.picking_line_id is not null;
Symptoms

The symptoms for this issue can be similar to Note:1471606.1 Inventory Standard Datafix Instruction #16: Fixing Stuck transaction with 'Error Occurred While Relieving Reservations'. In addition, you might find transactions preventing period close when the records are actually duplicates that can be deleted.

Symptom List

Here are some common observations, symptoms and errors that identify this issue.

Action Result
Close period   The period cannot close due to pending transactions.
Pick release   Pick release backorders line
Transact or allocate move order    
Transact or allocate fails. Receive an error:
The material sourcing process failed to create picking suggestions for line

View Material Workbench Available Quantity       Onhand quantity is MORE than available quantity but you have no current move orders or reservations.
Ship confirm  Onhand quantity is MORE than available quantity but you have no current move orders or reservations.
Ship confirm 
Ship confirm fails. Receive an error:
An error occurred while relieving reservations
(Code: INV_RSV_RLF_FAILED)



B - Verifying your File Versions.

Execute the following from your server for getting key file versions of the following files:

TrxProcessor.java
BaseTransaction.java
INVTXMGB.pls
INVTRXWB.pls

You can use SQL like the following:

set serveroutput on
PROMPT : - - - - : TrxProcessor.java : - - - - :
exec fnd_aolj_util.getClassVersionfromDB('oracle.apps.inv.transaction.server.TrxProcessor');

PROMPT : - - - - : BaseTransaction.java : - - - - :
exec fnd_aolj_util.getclassversionfromdb('oracle.apps.inv.transaction.server.BaseTransaction');

PROMPT : - - - - : INVTXMGB.pls : - - - - :
SELECT text FROM dba_source
 WHERE name = 'INV_TXN_MANAGER_PUB'
    AND line < 3;

PROMPT : - - - - : INVTRXWB.pls : - - - - :
SELECT text FROM dba_source
 WHERE name = 'INV_LPN_TRX_PUB'
    AND line < 3;
Or review the AppsCheck output from Note 276207.1 for application parameter: Inventory

C -  Root Cause Analysis.

The following Root Causes have been identified at this moment.

1. Duplicate Transactions After One In Batch Failed

While processing transactions through open interface, if batch id is populated and if the first row in a batch fails then the previous batch, which got successfully processed was not getting deleted from pending transactions table and open interface table.                                                         

Release         Bug     Patch  Filename       Version
R11.5.8         Bug 3024133  Patch 2640488         BaseTransaction.java          115.111.11580.5+
R11.5.10       Bug 5710072  Patch 5935177         BaseTransaction.java          115.235.115100.36+
R12.0.x         Bug 5748351  Patch 6728000:R12.0.6       TrxProcessor.java
BaseTransaction.java
INVTXMGB.pls
INVTRXWB.pls          120.10.12000000.4+
120.39.12000000.2+
120.25.12000000.3+
120.34.12000000.11+


2. New Root- Causes?

We are always looking for additional reasons for data issues. If you are on a higher version or can replicate the issue for a different situation, please log a service request.

IMPORTANT: If you are in higher file version please log a SR with Support Services or update the existing one providing this note number and the script output from section A and the file versions from section B and we will add your SR to the Internal Root Cause Analysis (RCA) Bug 8857390 for Release 12 and RCA Bug 9270328 for release 11i.

Also, if you are in higher file versions and you can replicate this issue, we would like to hear more on how you do it and then we can log a new bug focusing on fixing the issue. Please log a SR with Support Services or update the existing one with replication steps.



D - Datafix.

Follow the steps below to fix the data. The following temporary views are created to facilitate the backup table creation and the datafix. You can drop these views later if desired:

View   Explanation
mmt_mti_records_v  Compare the historical transactions to the interface transactions.
mmtt_mti_records_v Compare the pending transactions to the interface transactions.
mmt_mmtt_records_v        Compare the historical transactions to the pending transactions.


1. Identify data.

Please run the identification script (INV17-ident.sql) uploaded into this document.

2. Backup data.

Run the backup script (INV17-backup.sql). The backup script creates the following tables: mti_dup_backup, msni_dup_backup, mtli_dup_backup, mti_dup_backup_mmtt, msni_dup_backup_mmtt, mtli_dup_backup_mmtt, mmtt_dup_backup, msnt_dup_backup, mtlt_dup_backup

3. Run the datafix script.

Run the datafix script (INV17-datafix.sql) uploaded into the note. This will fix the data by removing duplicate transactions.

Note: The script DOES commit.
4- Check the data.

Check if your data has been corrected and you are not experiencing problems. You can rerun the script from the identification section:  (INV17-ident.sql) uploaded into this document.

Note: You may also need to submit any good, remaining transactions. For example, you could check for unprocessed records, resubmit any you can via the form, rerun the inventory manager, rerun trip stop, etc. See Note:1069492.1 Resolving Period Close Pending Transaction R12 that includes SQL to update transactions as well.

For example, this SQL could resubmit unprocessed pending transactions that you cannot see via the form because they are transaction mode 8:

update mtl_material_transactions_temp
 set process_flag = 'Y',
 lock_flag = 'N',
 transaction_mode = 3,
 error_code = NULL,
 error_explanation = NULL
where process_flag in ('Y','E')


References

NOTE:568012.1 - FAQ: Inventory Standard Datafixes
NOTE:280400.1 - Stuck Transaction Interface Sales Order Issues: An Error Occured While Relieving Reservations (INV_RSV_RLF_FAILED)
NOTE:294391.1 - What do the transaction mode (like transaction_mode = 8) numbers mean in the pending transactions table (MTL_MATERIAL_TRANSACTIONS_TEMP)?



Attachments


Friday, March 29, 2013

Performance: Concurrent Requests Hang in Pending Status For Long Time


Performance: Concurrent Requests Hang in Pending Status For Long Time

Applies to:

Oracle Concurrent Processing - Version 12.0.0 to 12.1.3 [Release 12 to 12.1]
Information in this document applies to any platform.
Symptoms

Concurrent managers slow performance leaves many concurrent requests in the Pending/Normal status, extending the completion time due to the prolonged duration of the Pending/Normal state.

Changes

Fresh installation /upgrade to R12

Cause

The cause of this problem has been identified in Bug 9301929 , the relevant SQL code had not been tuned and the FND_CONCURRENT_REQUESTS_N2 index required more columns to improve its performance.
Solution

To implement the solution, please execute the following steps:

For 12.1.x

Apply Patch 12877707 . Update file afcmgr.odf to version 120.19.12010000.2 or higher.

Patch 12877707 modifies index FND_CONCURRENT_REQUESTS_N2 to include program_application_id  and  concurrent_program_id  following  existing  status_code. This improves the performance of the concurrent manager sub-system.

For 12.0.x

Apply Patch 10388925 . Update file afcmgr.odf to version 120.16.12000000.8 or higher.

@ FND_CONCURRENT_REQUESTS  FND_CONCURRENT_REQUESTS_U2 INDEX
@ create INDEX on column STATUS_CODE , PROGRAM_APPLICATION_ID ,
@ CONCURRENT_PROGRAM_ID hang in pending status long time

Wednesday, March 20, 2013

Is There a Script to Identify the Session Identifier (SID) for an Actual Individual Apps User?



Is There a Script to Identify the Session Identifier (SID) for an Actual Individual Apps User?

goal: Is there a script to identify the session identifier (SID) for an
actual individual user in Oracle Applications?
fact: Oracle Application Object Library


fix:

All users in Oracle Applications show up as user APPS. Oracle Applications uses
the database user APPS for every one of its users.

Use the following SQL query to identify the sid and serial# associated with the
session identified in the Monitor Users form:
       SELECT SUBSTR(d.user_name,1,30) "User Name"
       , a.pid
       , b.sid
       , b.serial#
       FROM v$process a, v$session b, fnd_logins c, fnd_user d
       WHERE a.pid = c.pid
       AND c.pid = &PID
       AND d.user_name = UPPER('&USER_NAME')
       AND TO_DATE(c.start_time) = TO_DATE('&START_DATE')
       AND d.user_id = c.user_id
       AND a.addr = b.paddr
       AND c.end_time IS NULL
       /
2.When prompted for "PID" enter the value that appears under the
Oracle Process column on the form.
       .
3.When prompted for "USER_NAME" enter the value that appears under
the User Name column on the form.
       .
4.When prompted for "START_DATE" enter the Date that the user started
the session.
       .
Note: This value has to be determined based on how long the user has been
signed on the system. For instance if the user has been signed on for 10 hours
and the current time is 12:00 noon the current date would be the value that
should be entered.
       .
5.To kill the session make note of the SID and SERIAL# returned from the query
       .
6.Kill the session with the following comands:
SQL] ATLER SYSTEM KILL SESSION '[SID], [SERIAL#]';
ALTER SYSTEM KILL SESSION '[SID], [SERIAL#]';
       .
EXAMPLE:
For the example the following information was entered:
       .
PID = 35
USER_NAME = ZZJONES
START_DATE = 28-mar-00:
       .
       Enter value for pid: 35
       old 7: AND c.pid = &PID
       new 7: AND c.pid = 35
       Enter value for user_name: zzjones
       old 8: AND d.user_name = UPPER('&USER_NAME')
       new 8: AND d.user_name = UPPER('zzjones')
       Enter value for start_date: 28-mar-00
       old 9: AND TO_DATE(c.start_time) = TO_DATE('&START_DATE')
       new 9: AND TO_DATE(c.start_time) = TO_DATE('28-mar-00')
       .
       User Name PID SID SERIAL#
       ------------------------------ --------- --------- ---------
       ZZJONES 35 14 1764
       ZZJONES 35 15 2663
       .
Two rows are returned, because one database session is established for the
Navigator form and a second session is established for any form that is
launched from the Navigator form. It is possible that only one row will be
returned from
the query that corresponds to the navigator form.
       .
ALTER SYSTEM KILL SESSION '14, 1764';
ALTER SYSTEM KILL SESSION '15, 2663';

Tuesday, March 19, 2013

R12.1 hot backup - Using Hot Backup on Open Database

Cloning Oracle Application 11i /R12 with Rapid Clone - Database (9i/10g/11g)

 Using Hot Backup on Open Database

Oracle Applications Manager - Version 11.5.10.0 to 12.0.6 [Release 11.5.10 to 12]
Information in this document applies to any platform.
Goal

This purpose of this article is to help to duplicate/clone the Active/Open database to another machine

Fix

You need to follow the "pre-requisite" and "preparation" steps from section 1 and 2 of the cloning note applicable to your EBS Version:

Release 11i  : Note 230672.1 - 'Cloning Oracle Applications Release 11i with Rapid Clone'
Release 12  : Note 406982.1 - 'Cloning Oracle Applications Release 12 with Rapid Clone'


This Note helps you to implement the steps mentioned in "Appendix B: Recreating database control files manually in Rapid Clone" as per above Clone Note.

Step 1: Ensure adpreclone.pl has been run

Step 2: Obtain a trace file script to recreate the controlfile. On the source database issue the following
            command:


SQL> ALTER DATABASE BACKUP CONTROLFILE TO TRACE;


The trace file script will be put into the user_dump_dest directory. The name of the trace file script will be something like PROD_ora_12345.trc.
Compare the date and time of the new trace file script to the time in which you entered the ALTER DATABASE BACKUP CONTROLFILE TO TRACE command.
This will ensure you will be using the most recent trace file script, the one you created in this step


Step 3: In the create controlfile script just created in step 2 change:

CREATE CONTROLFILE REUSE DATABASE "PROD" NORESETLOGS

to:

CREATE CONTROLFILE DATABASE "PROD" RESETLOGS ARCHIVELOG
If you want to change the Database Name , You need to use the clause SET DATABASE in the create control file script as follows:

CREATE CONTROLFILE SET DATABASE "newdbname" RESETLOGS NOARCHIVELOG
You must specify RESETLOGS.

The ARCHIVELOG mode may be changed to NOARCHIVELOG if you wish to run the copied database in noarchive log mode. Change all directories in the create controlfile clause to point to the correct directories for the new target database, if necessary.

Leave "only" the CREATE CONTROLFILE clause. The other statements, like the recover command, will be done manually. Be sure you also remove the STARTUP NOMOUNT command.

Note:  Please ensure that there is no new datafile/tablespace added to Database after you generate controlfile script as above


Step 4: On the source database make an online copy of all datafiles using:


SQL> ALTER TABLESPACE BEGIN BACKUP;

Copy all datafiles within tablespace to the new directory. 
On Unix systems, this can be done with the cp command.

Then do:


SQL> ALTER TABLESPACE END BACKUP;

Do NOT copy the controlfiles and redo log files as they will be recreated. You must copy the datafiles only after the ALTER .. BEGIN BACKUP command has been executed, otherwise the datafiles may be corrupted.

The names of the datafiles and tablespaces to which the datafiles belong can be obtained using the following command:


SQL> SELECT FILE_NAME, TABLESPACE_NAME FROM DBA_DATA_FILES;

Note: Instead of performing step 4 and step 5 to create a new online backup, you may instead use a previously taken online backup of your database.If you choose to use a previous online backup be sure to copy the required archived redo logs taken with the the previous online backup.

Step 5: After all datafiles have been copied and the tablespaces taken out of backup mode issue the following command:


SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;

You will need all of the archivelog files from the start of datafile copy commands including the one just created with the command ALTER SYSTEM ARCHIVE LOG CURRENT.

Step 6: Copy the database (DBF) files,controlfile script and archive log files from the source to the target
           system

Step 7: So, As mentioned in 230672.1 (Appendix B), Replace section 2.2a (Configure the target system database server) with the following steps:

Execute the following commands to configure the target system. You will be prompted for the target system specific values (SID, Paths, Ports, etc)

Log on to the target system as the ORACLE user
Configure the
cd /appsutil/clone/bin
perl adcfgclone.pl dbTechStack

Step 7: On the target system issue STARTUP NOMOUNT command. For example:
     

SQL> startup nomount pfile=initTEST.ora


Step 8: Run the prepared script created in step 3 to create the new controlfile. For example:


SQL> @PROD_ora_12345.trc

Step 9: Issue the command:
         

SQL> RECOVER DATABASE UNTIL CANCEL USING BACKUP CONTROLFILE


You will be prompted to apply all of the archived redo logs from the source database including
the last archive redo log file created with the ALTER DATABASE ARCHIVE LOG CURRENT
command from step 5.

After applying all of these archive log files issue the CANCEL command.

Step 10: Open the database with resetlogs:
         

SQL>ALTER DATABASE OPEN RESETLOGS

 At this point the target database will have been successfully cloned and opened.

Step 11:  Create Temporary Tablespace if not created in Source, else you shall add Temporary tablespace

You can check if tablespace TEMP has tempfiles or datafiles using the following SQL:


SQL> SELECT FILE_NAME,TABLESPACE_NAME,STATUS,AUTOEXTENSIBLE from DBA_TEMP_FILES where TABLESPACE_NAME like 'TEMP';

SQL> SELECT FILE_NAME,TABLESPACE_NAME, STATUS,AUTOEXTENSIBLE FROM DBA_DATA_FILES WHERE TABLESPACE_NAME LIKE 'TEMP';

If Temporary Tablespace is not created from above query,

SQL> create temporary tablespace temp add tempfile 'xxxx.dbf' size xx

Or


SQL> alter tablespace TEMP add tempfile  'xxxx.dbf' size xx


Step 12:  Run the library update script against the database


cd /appsutil/install/
sqlplus "/ as sysdba" @adupdlib.sql
      where is "sl" for HP-UX, "so" for any other UNIX platform and 
      not required for Windows.


Step 13: Configure the target database (the database must be open)


cd /appsutil/clone/bin
perl adcfgclone.pl dbconfig
     where target context file is:
     /appsutil/.xml


Finally, refer back to cloning notes and the following sections:

Copy the Application Tier File System
Configure the Target System Application Tier Server Nodes
Finishing Tasks


IMAPSSL Workflow Mailer Setup Using Self Signed Certificate




IMAPSSL Workflow Mailer Setup Using Self Signed Certificate

Goal

The purpose of this document is to enable customers to use a self signed certificate with the Workflow Mailer for IMAPSSL.  These steps must be followed in order to avoid the untrusted certificate error being thrown by the minimum supported J2SE (JDK) 1.4.2 for the concurrent manager node.  The Workflow Mailer uses the certificate keystore of the J2SE.  Patch 4676589, '11i.ATG_PF.H.RUP4' is minimum recommended version of ATG for users of IMAPSSL.

javax.mail.MessagingException: sun.security.validator.ValidatorException: No trusted certificate found;

ASSUMPTION

The 3rd party IMAP email server is already configured, tested and verified that it will work with IMAPSSL.  Oracle does not provide instructions on how to implement IMAPSSL on 3rd party products.

Fix

1. Source APPSORA.env

2. Place the self signed certificate created for your IMAP Email Server on the Concurrent Manager Node assigned to the Workflow Mailer Service.

3. Use J2SE 1.4.2 and the J2SE(JDK) keytool to create a standalone keystore or import and trust the self signed certificate into the JDK keystore.

a. Login as the OS user that owns the appsTier containing the Concurrent Manager Server node running the Workflow Mailer Service.

b. It is better to create a standalone keystore to mimimize maintenance as the J2SE keystore (cacert) will be different everytime the JDK is upgraded to a new version.

c. Keytool will create a hidden file called .keystore in the OS user home directory.

NOTE:  Keytool is a 3rd party utility whose syntax is not supported by Oracle.  Please research on the Internet if unfamiliar with utility.

4. Test that your keystore is valid from the command line:

a. Connectivity of IMAP server
    ------------------------------
Test invocation is:
$AFJVAPRG -classpath $AF_CLASSPATH -Dprotocol=imap \
( -Ddbcfile= | -Ddbuser -Ddbpassword -Ddburl )\ 
-Dserver= [-Dport= default 143] \ 
-Daccount= -Dpassword=
[ -Dfolder= ] \ 
[ -Dconnect_timeout=5 ] \
[ -Dssl= default N ] \ 
[ -Dtruststore= ]\ 
[ -Dconnect_timeout= default 5 ] \ 
[ -Ddebug= default N ]\ 
[ -Dlogfile= default test.log ]\ 
oracle.apps.fnd.wf.mailer.Mailer

b. IMAPSSL Test Example and Valid Result
----------------------------------------------

 $AFJVAPRG -classpath $AF_CLASSPATH -Dprotocol=imap \
-Ddbcfile=$FND_TOP/secure/VIS_orlncatst-02/vis.dbc.dbc \
-Dport=993 -Dssl=Y \
-Dtruststore=/home/applmgr/.keystore \
-Dserver=testuser.us.oracle.com \
-Daccount=orlncatst02 -Dpassword=orlncatst02 \
-Dconnect_timeout=120 -Ddebug=Y \
-Dlogfile=/tmp/garyimaptest.log -DdebugMailSession=Y oracle.apps.fnd.wf.mailer.Mailer

Server testuser.us.oracle.com at port 993 is reachable
Debug property -> {true}

DEBUG: getProvider() returning javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc]
* OK dovecot ready.
A0 CAPABILITY
* CAPABILITY IMAP4rev1 SORT THREAD=REFERENCES MULTIAPPEND UNSELECT LITERAL+ IDLE CHILDREN LISTEXT LIST-SUBSCRIBED NAMESPACE AUTH=PLAIN
A0 OK Capability completed.
A1 LOGIN orlncatst02 orlncatst02
A1 OK Logged in.
A2 NOOP
A2 OK NOOP completed.
Successfully connected to the IMAP account
Note: Special folders like Inbox/Trash may not get listed on some IMAP servers
Folders defined are:
A3 LSUB "" "*"
* LSUB () "/" "Trash"
* LSUB () "/" "Processed"
A3 OK Lsub completed.
Trash
Processed
A4 LOGOUT
* BYE Logging out
A4 OK Logout completed.
A5 LOGOUT

5. Verify that you have the Workflow Mailer already configured and working on the default non-SSL port 143. If 143 is not available, login to E-Business Suite (EBS) and navigate to Workflow Mailer inside OAM and set Inbound Thread Count = 0 so that one can input the IMAP User Name and Password without validation.

Login to E-Business as a user assigned the System Administrator responsibility and navigate:

System Administrator > Oracle Applications Manager > Workflow > Notification Mailers > Edit > Advanced

6. Run $FND_TOP/sql/afsvcpup.sql from sqlplus to set the following parameters for the Workflow Mailer:

Working Example on ATG RUP3
----------------------------------

NOTE: You can get the component id and parameter id by running these queries:


SELECT component_id, component_name
FROM fnd_svc_components c
WHERE component_name like 'Workflow Notification Mailer'
order by component_id;

COMPONENT_ID COMPONENT_NAME
------------ --------------------------------------------------------------------------------
10006 Workflow Notification Mailer



set pagesize 100
set linesize 132
set feedback off
set verify off
set wrap off

col comp_param_id 999999999
col parameter_value format a35
col component_name format a30

select v.component_parameter_id comp_param_id, v.parameter_value, c.component_name
from fnd_svc_comp_param_vals_v v, fnd_svc_comp_params_b p, fnd_svc_components c, fnd_svc_comp_params_vl vl
where c.component_type = 'WF_MAILER'
and v.component_id = c.component_id
and v.parameter_id = p.parameter_id
and vl.parameter_id = p.parameter_id
and p.parameter_name in ('MAILER_SSL_TRUSTSTORE');

COMP_PARAM_ID PARAMETER_VALUE                     COMPONENT_NAME
------------- ----------------------------------- ----------------------------
        10475 /home/applmgr/.keystore             Workflow Notification Mailer
        11011 NONE                                Cs_MsgsMailer
        10741 NONE                                AG_Mailer
        10521 NONE                                Oracle Alert Email
a. Example:

Updating Debug Mail Session:

sqlplus apps/ @$FND_TOP/sql/afsvcpup.sql


Enter Component Id:


Enter the Parameter Id to update :

You have selected parameter : Debug Mail Session
Current value of parameter : N

Enter a value for the parameter : Y

b. Update the following Parameters:

10082 Inbound Thread Count 1
10025 Debug Mail Session Y (Optional setting to obtain diagnostics data and should be set to N after a successful test)
10140 Inbound SSL Enabled Y
10475 SSL Trust store /home/applmgr/.keystore (My standalone keystore)

7. Shutdown and restart the Workflow Mailer Service from inside OAM.

8. Confirm that the Workflow Mailer starts and will process inbound responses from the Workflow Mailer inbox.


How to setup an IMAP server on LINUX for E-Business Suite usage


How to setup an IMAP server on LINUX for E-Business Suite usage

Applies to:

Oracle Workflow Cartridge
Linux x86
Oracle Application Object Library - Version: 11.5.5 to 11.5.10
Goal

This note will guide you through the steps to allow you to set up an IMAP server so that you can respond to Notifications via e-mail and fully implement the "Forgot Password" functionality.
Solution

1. Install Dovecot IMAP/POP3 Mailer
- check if dovecot is installed
$ rpm -q dovecot

- Download dovecot-0.99.13-1.2.el4.test.i386.rpm if needed
( http://dag.wieers.com/packages/dovecot/ )


2. Install sendmail-mc if it is not installed


3. Create directory structure for dovecot if needed
- /var/run/dovecot/login
- /var/run/dovecot-login


4. Setup sendmail by editing mail configuration files

a. Look for and edit the following lines as needed in /etc/mail/sendmail.mc. Remove the "dnl" at the beginning of the line to make the line active.  Replace the IP address and host with your local values.

- LOCAL_DOMAIN(`AOL-linux.us.oracle.com')dnl
- MASQUERADE_DOMAIN(AOL-linux.us.oracle.com)dnl
- MASQUERADE_DOMAIN(AOL-linux)dnl

Change the following line to allow connection from the Internet. Be aware that this opens up your sendmail to public access.

From:
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
To:
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl


b. Add a line with your IP Address in /etc/mail/access
###.##.##.### RELAY

c. Add your hostname and full qualified hostname as needed in /etc/mail/local-host-names
AOL-linux.us.oracle.com
AOL-linux

d. Add mail accounts as needed in /etc/mail/virtusertable
applmgr@AOL-linux.us.oracle.com applmgr
wfmailer@AOL-linux.us.oracle.com wfmailer

e. Compile the mail configuration files
- $ make

f. Restart the sendmail service
- $ service sendmail restart


5. Setup dovecot by editing /etc/dovecot.conf. Edit and/or add the following lines as needed. These values are set for small usage and most defaults are being used for processes. Remove the comments (#) from any lines as needed.


Change the following and/or remove comment:

protocols = imap pop3
default_mail_env = mbox:~/mail:INBOX=/var/mail/%u
auth_userdb = passwd
mbox_locks = fcntl

base_dir = /var/run/dovecot
login_dir = /var/run/dovecot/login
imap_listen = *
pop3_listen = *
login_executable = /usr/libexec/dovecot/imap-login
login_user = dovecot
login_executable = /usr/libexec/dovecot/pop3-login
imap_executable = /usr/libexec/dovecot/imap
pop3_executable = /usr/libexec/dovecot/pop3
auth_executable = /usr/libexec/dovecot/dovecot-auth
auth_count = 1

These are already defaulted:

login = imap
login = pop3
auth = default
auth_mechanisms = plain
auth_user = root


6. Start the dovecot service (root user)

$ service dovecot start


7. Test connect to sendmail account testmail

$ telnet testsystem.domain 25
$ helo  
$ quit

Example:

$ telnet testsystem.domain 25
Trying ###.#.##.###...
Connected to testsystem.domain (###.#.##.###).
Escape character is '^]'.
220 testsystem.domain ESMTP Sendmail 8.13.1/8.13.1; Fri, 3 Mar 2006 15:24:02 -0500
helo AOLTest-sun
250 testsystem.domain Hello testsystem.domain [###.#.##.###], pleased to meet you
quit
221 2.0.0 testsystem.domain closing connection
Connection closed by foreign host.


8. Test connection to the Dovecot IMAP vaild user - i.e. "testmail" with password "testmail1"

Type the following three commands:

$ telnet testsystem.domain 110
$ user testmail
$ pass testmail1

Example:

$ telnet testsystem.domain 110
Trying ###.#.##.###...
Connected to testsystem.domain (###.#.##.###).
Escape character is '^]'.
+OK dovecot ready.
user testmail
+OK
pass testmail1
+OK Logged in.
quit
+OK Logging out.
Connection closed by foreign host.


9. Configure an E-mail client to test you IMAP Server

Outlook 2000

a. Open Outlook

b. Click Tools -> Accounts

c. Click the [Add] button then choose “Mail” to create a new account

d. Choose the Account Name and click the [Next] button

e. Verify the email address (i.e. wfmailer@dovecot host.com)

f. Click the (next] button

g. Choose IMAP for the incomping Mail server

h. Enter the Server Name into the “Incoming Mail Server” and “Outgoing Mail Server” fields

i. Click the [Next] button

j. Enter the Username(wfmailer) and Password

k. Click the [Next] button

l. Choose the LAN connection type

m. Click the [Next] button

n. Click the [Finish] button to save the settings

o. Click the [Close] button on the “Internet Accounts” screen

Friday, March 15, 2013

FNDLOAD


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/valuesets developed in DEVELOPMENT instance to PRODUCTION instance you can direct use this command.


Steps to Move a Concurrent program from one instance(Database) to other

· Define your concurrent program and save it in first instance(for how to register a concurrent program click here)
· Connect to your UNIX box on first instance and run the following command to download the .ldt file

FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct file_name.ldt PROGRAM APPLICATION_SHORT_NAME="Concurrent program application short name" CONCURRENT_PROGRAM_NAME="concurrent program short name"

· Move the downloaded .ldf file to new instance(Use FTP)
· Connect to your UNIX box on second instance and run the following command to upload the .ldt file

              FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/afcpprog.lct
              file_name.ldt


Note: Make sure you are giving proper .lct file in the commands and don’t confuse with .lct and .ldt files


These following are the other entity data types that we can move with FNDLOAD
1 - Printer Styles
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcppstl.lct file_name.ldt STYLE PRINTER_STYLE_NAME="printer style name"

2 - Lookups
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/aflvmlu.lct file_name.ldt FND_LOOKUP_TYPE APPLICATION_SHORT_NAME="FND"
LOOKUP_TYPE="lookup name"

3 - Descriptive Flexfield with all of specific Contexts
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt DESC_FLEX P_LEVEL=’COL_ALL:REF_ALL:CTX_ONE:SEG_ALL’ APPLICATION_SHORT_NAME="FND" DESCRIPTIVE_FLEXFIELD_NAME="desc flex name" P_CONTEXT_CODE="context name"

4 - Key Flexfield Structures
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt KEY_FLEX P_LEVEL=’COL_ALL:FQL_ALL:SQL_ALL:STR_ONE:WFP_ALL:SHA_ALL:CVR_ALL:SEG_ALL’ APPLICATION_SHORT_NAME="FND" ID_FLEX_CODE="key flex code" P_STRUCTURE_CODE="structure name"

5 - Concurrent Programs
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpprog.lct file_name.ldt PROGRAM APPLICATION_SHORT_NAME="FND" CONCURRENT_PROGRAM_NAME="concurrent name"

6 - Value Sets
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt VALUE_SET_VALUE FLEX_VALUE_SET_NAME="value set name"

7 - Value Sets with values
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afffload.lct file_name.ldt VALUE_SET FLEX_VALUE_SET_NAME="value set name"

8 - Profile Options
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscprof.lct file_name.ldt PROFILE PROFILE_NAME="profile option" APPLICATION_SHORT_NAME="FND"

8 - Request Groups
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcpreqg.lct file_name.ldt REQUEST_GROUP REQUEST_GROUP_NAME="request group" APPLICATION_SHORT_NAME="FND"

10 - Request Sets
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afcprset.lct file_name.ldt REQ_SET
APPLICATION_SHORT_NAME="FND" REQUEST_SET_NAME="request set"

11 - Responsibilities
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afscursp.lct file_name.ldt FND_RESPONSIBILITY RESP_KEY="responsibility"

12 - Menus
FNDLOAD apps/apps O Y DOWNLOAD $FND_TOP/patch/115/import/afsload.lct file_name.ldt MENU MENU_NAME="menu_name"

13 - Forms Personalization
FNDLOAD apps/apps 0 Y DOWNLOAD $FND_TOP/patch/115/import/affrmcus.lct file_name.ldt FND_FORM_CUSTOM_RULES function_name=FUNCTION_NAME
Note: UPLOAD command is same for all except replacing the .lct and passing any extra parameters if you want to pass
               FNDLOAD apps/apps 0 Y UPLOAD $FND_TOP/patch/115/import/corresponding.lct
               upload_file.ldt