|
 |
|
Oracle applications scripts
Oracle Database Tips by Donald BurlesonJanuary 18, 2015
|
Oracle applications scripts
The data dictionary contains lots of useful information for the Oracle
applications DBA, especially the
concurrent
manager. For a complete set of Oracle scripts downloads, see the
BC Oracle script collection.
The following Oracle applications script can be executed to
identify requests based on the number of minutes the request ran:
set echo off
set feedback off
set linesize 97
set verify off
col request_id format 9999999999 heading "Request ID"
col exec_time format 999999999 heading "Exec Time|(Minutes)"
col start_date format a10 heading "Start Date"
col conc_prog format a20 heading "Conc Program Name"
col user_conc_prog format a40 trunc heading "User Program Name"
spool long_running_cr.lst
SELECT
fcr.request_id request_id,
TRUNC(((fcr.actual_completion_date-fcr.actual_start_date)/(1/24))*60) exec_time,
fcr.actual_start_date start_date,
fcp.concurrent_program_name conc_prog,
fcpt.user_concurrent_program_name user_conc_prog
FROM
fnd_concurrent_programs fcp,
fnd_concurrent_programs_tl fcpt,
fnd_concurrent_requests fcr
WHERE
TRUNC(((fcr.actual_completion_date-fcr.actual_start_date)/(1/24))*60) > NVL('&min',45)
and
fcr.concurrent_program_id = fcp.concurrent_program_id
and
fcr.program_application_id = fcp.application_id
and
fcr.concurrent_program_id = fcpt.concurrent_program_id
and
fcr.program_application_id = fcpt.application_id
and
fcpt.language = USERENV('Lang')
ORDER BY
TRUNC(((fcr.actual_completion_date-fcr.actual_start_date)/(1/24))*60) desc;
spool off
Note that this script prompts you for the number of minutes. The output
from this query with a value of 60 produced the following output on my
database. Here we can see important details about currently-running
requests, including the request ID, the execution time, the user who
submitted the program and the name of the program.
Exec Time
Request ID (Minutes) Start Date Conc Program Name User Program Name
----------- ---------- ---------- -------------------- --------------------------------------
1445627 218 01-SEP-02 MWCRMRGA Margin Analysis Report(COGS Breakups)
444965 211 03-JUL-01 CSTRBICR5G Cost Rollup - No Report GUI
1418262 208 22-AUG-02 MWCRMRGA Margin Analysis Report(COGS Breakups)
439443 205 28-JUN-01 CSTRBICR5G Cost Rollup - No Report GUI
516074 178 10-AUG-01 CSTRBICR6G Cost Rollup - Print Report GUI
This Oracle applications script will query the fnd_application
table:
select substr(a.application_name,1,30)
application_name,
substr(b.product_version,1,7)
application_version,
decode(b.status, 'i', 'installed',
's', 'shared',
'n', 'not installed',
'l', 'custom',
b.status) prod,
decode(b.industry, 'c', 'commercial',
'g', 'educational',
'b', 'project billing',
'p', 'project costing',
b.industry ) industry,
substr(b.tablespace,1,10) "data",
substr(b.index_tablespace,1,10) "index",
substr(b.temporary_tablespace,1,10) "temp",
b.sizing_factor "sizing
from applsys.fnd_application a,
applsys.fnd_product_groups c,
applsys.fnd_oracle_userid d,
applsys.fnd_product_installations b
where a.application_id = b.application_id
and b.oracle_id = d.oracle_id
order by
a.application_name
 |
If you like Oracle tuning, you may enjoy the book
Oracle Tuning: The Definitive Reference , with over 900 pages of BC's favorite tuning
tips & scripts.
You can buy it directly from the publisher and save 30%, and get
instant access to the code depot of Oracle tuning scripts. |
|