Wednesday, October 16, 2019

Find Responsibilities that can run a concurrent program

Below query tells which R12 responsibilities can run a particular concurrent program, such as "Purge Signon Audit data":

SELECT
    frt.responsibility_name,
    frg.request_group_name,
    frgu.request_unit_type,
    frgu.request_unit_id,
    fcpt.user_concurrent_program_name
FROM
    fnd_responsibility           fr,
    fnd_responsibility_tl        frt,
    fnd_request_groups           frg,
    fnd_request_group_units      frgu,
    fnd_concurrent_programs_tl   fcpt
WHERE
    frt.responsibility_id = fr.responsibility_id
    AND frg.request_group_id = fr.request_group_id
    AND frgu.request_group_id = frg.request_group_id
    AND fcpt.concurrent_program_id = frgu.request_unit_id
    AND frt.language = userenv('LANG')
    AND fcpt.language = userenv('LANG')
    AND fcpt.user_concurrent_program_name = 'Purge Signon Audit data'
ORDER BY 1,    2,    3,    4;

Thursday, September 12, 2019

Concurrent job hangs and stays at "Running" forever

To make all R12.1 services run on a single node, instead of on multiple apps-tier nodes, I followed 4 steps:

1. Edited $CONTEXT_FILE to make all 5 variables "enabled":

Root Service Group : s_root_status
Web Entry Point Services : s_web_entry_status
Web Application Services : s_web_applications_status
Batch Processing Services : s_batch_status
Other Service Group : s_other_service_group_status

2. Ran autoconfig on the single node 
3. Start all services, including concurrent managers on the single node. 
4. Keep all services down in all other nodes.

Everything worked without a problem. But, when I ran a concurrent request, such as "Active Users", the job stays hung and frozen forever.  Below query show it reached the database:

SQL> SELECT a.request_id, d.sid, d.serial# ,d.osuser,d.process , c.SPID
FROM apps.fnd_concurrent_requests a, apps.fnd_concurrent_processes b, v$process c, v$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.request_id = &Request_ID AND a.phase_code = 'R';

REQUEST_ID  SID    SERIAL#  OSUSER  PROCESS  SPID
----------------- ------- -------------- ----------- --------------- -------
33925067         2345   40605         ebsdev      18208          42991822

And, database server has its process  
$ ps -ef | grep 42991822
 oracle 42991822        1   0 16:31:07      -  0:00 oracleEBSDEV (LOCAL=NO)

After I cancelled the request from GUI Forms, the Standard Manager got crashed and posted a very misleading error in Manager's log: 

12-MON-20XX 21:55:43
Request  : 33925067
Priority : 50
Program  : 0/20641
State    : T

12-MON-20XX 21:55:43
Attempting process termination for process 17331 on node nodeName
12-MAR-2021 21:55:43 - Could not submit job to kill request session 33925067:

No such process
An error occured in client-side routine afpsmckp for Service Manager FNDSM_NodeName_EBSDEV.  The routine returned code 1. Check for preceding errors and as well as the service manager log file for further details."

12-MON-20xx 21:57:44 - Could not submit job to kill concurrent process 260751: Oracle error 100: ORA-01403: no data found has been detected in FND_CONC_RAC_UTILS.SUBMIT_MANAGER_KILL_SESSION.
Found dead process: spid=(17331), cpid=(260751), ORA pid=(74), manager=(0/0)
The real problem is exactly as described in Doc ID 737445.1 (R12 Concurrent Requests Run Forever, rwrun Errors with REP-50125) and the fix is to delete file $ORACLE_HOME/reports/conf/rwnetwork.conf.  Only below line will give the true error in file areport.trc.

$ $INST_TOP/ora/10.1.2/bin/appsrwrun.sh userid=apps/appsPWD mode=character report=$FND_TOP/reports/US/FNDSCURS.rdf \
batch=yes destype=file desname=./areport.out desformat=$FND_TOP/reports/HPL pagesize=132x66 traceopts=trace_all tracefile=areport.trc tracemode=trace_replace 

By the way, to totally remove a node from multiple nodes structure, run two steps BEFORE above 4 steps:
a) SQL>  EXEC FND_CONC_CLONE.SETUP_CLEAN 
b) Run autoconfig on database server.

Then, below two table shall have no data:
SQL> select * from fnd_concurrent_queues;
SQL> select * from fnd_concurrent_processes;
And below two tables shall have only one row:
SQL> select * from fnd_nodes;
SQL> select * from fnd_conflicts_domain;


Monday, July 22, 2019

How to start Background Engines

Login as a Sysadmin, Site Map => Work Item Metrics (under Workflow)

If you see Background Engines is not Up, start it manually. To start "Workflow Background Process": On the top right corner: Submit Request For >> Background Engines, click on Go

Schedule Background Engines with the following parameters (in R12.1):
















Then, the job status can be viewed from GUI forms: Request => View. To learn more on scheduling this job, see Performance Degradation when the Workflow Background Process is Running (Doc ID 743338.1).

Background Engine icon on OAM page may still show red Down status, even "Workflow Background Process" ran successfully. The job has to be repetitive (so that they run over and over). If it just runs once, the icon will change back to red X. 

Same way with jobs "Purge Obsolete Workflow Runtime Data" and "Workflow Control Queue Cleanup" to make two other icons stay in green on OAM page.

Tuesday, June 4, 2019

Init parameter in 12c database

Database Initialization Parameters for Oracle E-Business Suite Release 12 (Doc ID 396009.1) has recommendations on parameter values.  Below lists init parameters that are not set as the default to support a R12.1.3 instance with about 300 users at peak time.

NAMEVALUE
_b_tree_bitmap_plansFALSE
_fast_full_scan_enabledFALSE
_like_with_bind_as_equalityTRUE
_optimizer_autostats_jobFALSE
_sort_elimination_cost_ratio5
_sqlexec_progression_cost2147483647
_system_trig_enabledTRUE
_use_single_log_writerTRUE
aq_tm_processes4
audit_sys_operationsTRUE
audit_trailDB (default is NONE)
compatible12.1.0
control_file_record_keep_time30
control_files/path/to1/ctrl01.dbf, /path/to2/ctrl02.dbf, /path/to3/ctrl03.dbf
cursor_sharingEXACT
db_block_checkingFALSE
db_block_checksumTRUE
db_block_size8192
db_cache_size5368709120 (or, 5G)
db_files1000
db_nameEBSPROD
diagnostic_dest/path/to/db_ebsprod/admin/EBSPROD_ebsdb1p
dml_locks10000
filesystemio_optionssetall
java_jit_enabledFALSE
job_queue_processes20
local_listener(DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EBSPROD_ipc)))
log_archive_dest/path/to/EBSPROD/arch/arch.log
log_buffer10485760 (or, 10M)
log_checkpoint_interval100000
log_checkpoint_timeout1200
log_checkpoints_to_alertTRUE
max_dump_file_size10000
memory_max_target25769803776 (or, 24G)
memory_target25769803776
nls_compbinary
nls_date_formatDD-MON-RR
nls_languageAMERICAN
nls_length_semanticsBYTE
nls_numeric_characters.,
nls_sortbinary
nls_territoryAMERICA
olap_page_pool_size4194304 (or, 4M)
open_cursors4096
optimizer_adaptive_features FALSE
optimizer_secure_view_mergingFALSE
os_authent_prefixext$
parallel_max_servers64
parallel_min_servers0
parallel_servers_target64
parallel_threads_per_cpu2
pga_aggregate_limit0
pga_aggregate_target0 (this is the default. Could be set to 1G)
plsql_code_typeINTERPRETED
plsql_optimize_level0
processes3000
query_rewrite_enabledtrue
recovery_parallelism1
recyclebinON
remote_login_passwordfileNONE
remote_os_authentFALSE
sec_case_sensitive_logonFALSE
sec_protocol_error_further_action  drop,3
session_cached_cursors500
session_max_open_files100
sessions4536
sga_max_size25769803776 (or, 24G)
shared_pool_reserved_size214748364
shared_pool_size4294967296 (or, 4G)
sql92_securityTRUE
temp_undo_enabledTRUE
timed_statisticsTRUE
undo_managementAUTO
undo_retention43200
undo_tablespaceAPPS_UNDO_TBS
utl_file_dir/path/to/EBSPROD/utl_dir, /usr/tmp
workarea_size_policyAUTO

The database server is an IBM LPAR configuration. 4 Oracle databases on it share its resources of 6 cores CPUs and 92 GB memory, and it is all virtual.

parallel_max_servers =  Maximum value should be 2 X #of CPUs.
This parameter depends on the number of cores. It uses logical CPUs and 5 cores (4-way SMP).  The SMP threads don’t really replicate a full core.

optimizer_adaptive_features = FALSE
If it is set to true, queries may run OK on a first run, but poorly on subsequent runs. Oracle will try to adapt the plans using cardinality feedback and other features that can be good, but can also cause issues.

parallel_threads_per_cpu = 2
Because the core CPU are 4-way SMP, it shows 4x more CPUs than it really has. If it set to a higher value (say, 16), Oracle will keep overallocating the CPU resources for parallel queries and spinning up too many parallel threads for the memory and CPU that it has.

Thursday, May 23, 2019

APP-FND-02702: ABM is not a valid oracle user

Oracle file https://docs.oracle.com/cd/E26401_01/doc.122/e22952/T156458T659606.htm lists schemas names of Oracle EBS. But, some schemas became obsolete in R12.

EBS schema names must be in table FND_ORACLE_USERID and EBS user name must appear in table FND_USER.

All below schema owners are not in table FND_ORACLE_USERID in my R12.1.3 instances. It is safe to change their password by alter statement, such as "alter user ABM identified by new_Pwd;", while FNDCPASS will give error APP-FND-02702: ABM is not a valid oracle user because FNDCPASS utility and ALLORACLE functionality were designed for valid applications users/schemas.

SELECT ORACLE_ID, ORACLE_USERNAME, CREATION_DATE,LAST_UPDATE_DATE,ENABLED_FLAG,DESCRIPTION
  FROM apps.FND_ORACLE_USERID
WHERE ORACLE_USERNAME IN (
'ABM',
'AHM',
'AMF',
'CSS',
'CUE',
'CUN',
'EAA',
'EVM',
'FPT',
'IBA',
'IMT',
'IPD',
'ME',
'OKB',
'OKO',
'OKR',
'OZP',
'OZS',
'RHX',
'RLA',
'VEH',
'XNC',
'XNI',
'XNM',
'XNS',
);