Saturday, October 3, 2015

Concurrent jobs that should run periodically

In a production environment, some concurrent jobs are necessary to keep the system running smoothly. Below list covers good candidates.

USER_CONCURRENT_PROGRAM_NAME        CONCURRENT_PROGRAM_NAME
Workflow Background Process                               FNDWFBG
Workflow Control Queue Cleanup                            FNDWFBES_CONTROL_QUEUE_CLEANU
Workflow Directory Services User/Role Validation     FNDWFDSURV
Purge Obsolete Workflow Runtime Data                  FNDWFPR
Purge Concurrent Request and/or Manager Data      FNDCPPUR (one on request logs)
Purge Concurrent Request and/or Manager Data      FNDCPPUR (one on manager logs)
Delete Diagnostic Statistics                                   DELDIAGSTAT
Purge Logs and Closed System Alerts                    FNDLGPRG
Purge Inactive Sessions                                    FNDDLTMP (delete data from table ICX_SESSIONS)
Request Set Gather Statistics Schemas (weekly run)  Gather Schema Statistics

One of the important ones is to collect statistics. A Request Set can be created for that by
Requests => Set => name it "Gather Statistics Schemas (weekly run)"
Then, Define Stages => Requests =>
Enter a Seq number and select seeded Program "Gather Schema Statistics" for each schema (AR, GL, XLA, APPS, APPLSYS, ...). Make sure the Owner is sysadmin, otherwise sysadmin may be unable to see it. If the parallel Degree 16 is not specified, it will take the default from the database (I saw 32 in a run).


If job "Purge Concurrent Request and/or Manager Data" is not scheduled to run regularly, table fnd_env_context may become very big. You may have to truncate the table as the only option of reducing its size.

References:
- What Are Concurrent Reports That Should Be Scheduled Periodically [ID 1066117.1] .
- Why is The "Purge Inactive Sessions" Concurrent Program Not Deleting Records From ICX_SESSIONS? [ID 1073768.1].

Below query find all scheduled concurrent requests (or CM requests scheduled by a user):

SELECT
    fr.responsibility_key responsibility,
    fcp.concurrent_program_name,
    fcpt.user_concurrent_program_name,
    decode(fcr.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,
    decode(fcr.phase_code,
        'C', 'Completed',
        'I', 'Inactive',
        'P', 'Pending',
        'R', 'Running') phase,
    fcr.request_id,
    fcr.parent_request_id,
    fu.user_name requestor,
    to_char(fcr.requested_start_date, 'MON-DD-YYYY HH24:MM:SS') START_DATE,
    fcr.completion_text
FROM
    fnd_concurrent_requests fcr,
    fnd_concurrent_programs fcp,
    fnd_concurrent_programs_tl fcpt,
    fnd_user fu,
    fnd_responsibility fr
WHERE
    --fcr.status_code in ('Q', 'I') and
    --fcr.hold_flag = 'N' and
    fcr.requested_start_date > sysdate and
    fu.user_id = fcr.requested_by and
    fcr.concurrent_program_id = fcp.concurrent_program_id and
    fcr.concurrent_program_id = fcpt.concurrent_program_id and
    fcr.responsibility_id = fr.responsibility_id
    -- and fu.user_name = 'UserName'
order by fcr.requested_start_date,  fcr.request_id;

2 comments:

J Y said...

If stats job runs too long, I read a web post suggesting below actions:

SQL> select distinct owner, table_name, stattype_locked
from dba_tab_statistics where stattype_locked is not null;
SQL> exec dbms_stats.unlock_schema_stats('SYS');
SQL> exec dbms_stats.unlock_table_stats('SYS','WRH$_SYSSTAT');

J Y said...

http://erpondb.blogspot.com/2009/10/list-of-scheduled-concurrent-requests.html posts a query for 11i