Usefull FND Queries

1. Concurrent Program Info

SELECT fcpt.user_concurrent_program_name Concurrent_Program
,fdfcu.column_seq_num Sequence_number
,fdfcu.DEFAULT_VALUE default_value
,fdfcut.form_left_prompt prompt
,fdfcut.description description
,ffvs.flex_value_set_name
,fl.meaning
,fe.executable_name
FROM apps.fnd_concurrent_programs fcp
,apps.fnd_concurrent_programs_tl fcpt
,apps.fnd_concurrent_programs_tl fcpd
,apps.fnd_descr_flex_col_usage_tl fdfcut
,apps.fnd_descr_flex_column_usages fdfcu
,apps.fnd_descr_flex_col_usage_tl fdfcud
,apps.fnd_application fa
, apps.fnd_flex_value_sets ffvs
, apps.fnd_lookups fl
, apps.fnd_executables fe
WHERE
fcpt.user_concurrent_program_name='Payables Open Interface Import'
AND fcp.concurrent_program_id = fcpt.concurrent_program_id
AND fcpt.concurrent_program_id = fcpd.concurrent_program_id
AND fdfcut.application_id = fa.application_id
AND fdfcut.descriptive_flex_context_code = 'Global Data Elements'
AND fdfcut.descriptive_flexfield_name = '$SRS$.'||fcp.concurrent_program_name
AND fdfcut.application_id = fdfcu.application_id
AND fdfcut.descriptive_flex_context_code = fdfcu.descriptive_flex_context_code
AND fdfcut.descriptive_flexfield_name = fdfcu.descriptive_flexfield_name
AND fdfcut.application_column_name = fdfcu.application_column_name
AND fdfcut.application_id = fdfcud.application_id
AND fdfcut.descriptive_flex_context_code = fdfcud.descriptive_flex_context_code
AND fdfcut.descriptive_flexfield_name = fdfcud.descriptive_flexfield_name
AND fdfcut.application_column_name = fdfcud.application_column_name
and fdfcu.flex_value_set_id = ffvs.flex_value_set_id
and fcp.EXECUTION_METHOD_CODE = fl.lookup_code
and fl.lookup_type = 'CP_EXECUTION_METHOD_CODE'
and fcp.executable_id = fe.executable_id
ORDER BY 1, 2 ,3


select cpt.USER_CONCURRENT_PROGRAM_NAME,
cpt.DESCRIPTION,
cp.CONCURRENT_PROGRAM_NAME,
a.APPLICATION_SHORT_NAME,
e.EXECUTABLE_NAME,
cp.CREATION_DATE,
uc.USER_NAME CREATOR,
cp.LAST_UPDATE_DATE,
ulu.USER_NAME UPDATER,
cp.ENABLED_FLAG,
cp.RUN_ALONE_FLAG,
cp.SRS_FLAG,
cp.PRINT_FLAG,
cp.SAVE_OUTPUT_FLAG,
cp.REQUIRED_STYLE,
cp.OUTPUT_PRINT_STYLE,
cp.PRINTER_NAME,
cp.MINIMUM_WIDTH,
cp.MINIMUM_LENGTH,
cp.OUTPUT_FILE_TYPE,
cp.ENABLE_TRACE,
cp.RESTART,
cp.NLS_COMPLIANT,
cp.REQUEST_SET_FLAG
from applsys.fnd_concurrent_programs cp,
applsys.fnd_concurrent_programs_tl cpt,
applsys.fnd_application a,
applsys.fnd_executables e,
applsys.fnd_user uc,
applsys.fnd_user ulu
where cp.CREATION_DATE > to_date('17-MAY-1995')-- Enter Creation Date
and cp.APPLICATION_ID = cpt.APPLICATION_ID
and cp.CONCURRENT_PROGRAM_ID = cpt.CONCURRENT_PROGRAM_ID
and cpt.LANGUAGE = sys_context('USERENV', 'LANG')
and cp.APPLICATION_ID = a.APPLICATION_ID
and cp.EXECUTABLE_APPLICATION_ID = e.APPLICATION_ID
and cp.EXECUTABLE_ID = e.EXECUTABLE_ID
and cp.CREATED_BY = uc.USER_ID
and cp.LAST_UPDATED_BY = ulu.USER_ID
and cpt.user_concurrent_program_name='Payables Open Interface Import'
order by cp.CONCURRENT_PROGRAM_NAME


2. Concurrent Program parameters

select cp.CONCURRENT_PROGRAM_NAME, cu.*, vs.FLEX_VALUE_SET_NAME
from applsys.fnd_concurrent_programs cp,
applsys.fnd_descr_flex_column_usages cu,
applsys.fnd_flex_value_sets vs
where cp.CREATION_DATE > to_date('17-MAY-1995') --Enter Creation Date
AND cu.application_id = cp.application_id
AND cu.descriptive_flexfield_name = '$SRS$.' || cp.concurrent_program_name
AND cu.FLEX_VALUE_SET_ID = vs.FLEX_VALUE_SET_ID
ANd cp.CONCURRENT_PROGRAM_ID=:CONCURRENT_PROGRAM_ID --(Enter CONCURRENT_PROGRAM_ID of CONCURRENT_PROGRAM)
order by cp.CONCURRENT_PROGRAM_NAME, cu.COLUMN_SEQ_NUM

3. Concurrent Request Details

select p.concurrent_program_name,
pt.user_concurrent_program_name,
rt.responsibility_name,
r.*
from applsys.fnd_concurrent_requests r,
applsys.fnd_concurrent_programs p,
applsys.fnd_concurrent_programs_tl pt,
applsys.fnd_responsibility rsp,
applsys.fnd_responsibility_tl rt
where r.request_id = &Request_ID -- Enter Request ID
and r.program_application_id = p.application_id
and r.concurrent_program_id = p.concurrent_program_id
and p.application_id = pt.application_id
and p.concurrent_program_id = pt.concurrent_program_id
and pt.language = sys_context('USERENV', 'LANG')
and r.responsibility_application_id = rsp.application_id
and r.responsibility_id = rsp.responsibility_id
and rsp.application_id = rt.application_id
and rsp.responsibility_id = rt.responsibility_id
and rt.language = sys_context('USERENV', 'LANG')

4. Request Group Details

select rga.application_short_name "Req Grp App",
rg.request_group_name "Request Group Name",
rg.request_group_code "Request Group Code",
rg.description "Request Group Desc",
cp.concurrent_program_name "Concurrent Program",
ea.application_short_name "Exec App",
e.executable_name "Executable",
rga.application_id "Req Grp App ID",
rg.request_group_id "Req Grp ID",
e.application_id "Exec App ID"
from applsys.fnd_executables e,
applsys.fnd_concurrent_programs cp,
applsys.fnd_request_group_units rgu,
applsys.fnd_request_groups rg,
applsys.fnd_application rga,
applsys.fnd_application ea
where e.application_id like '%' -- Enter Application ID
and e.executable_name like '%' -- Enter Executable Name
and cp.executable_application_id = e.application_id
and cp.executable_id = e.executable_id
and cp.enabled_flag = 'Y'
and rgu.request_unit_id = cp.concurrent_program_id
and rgu.unit_application_id = cp.application_id
and rgu.request_unit_type = 'P'
and rg.application_id = rgu.application_id
and rg.request_group_id = rgu.request_group_id
and rga.application_id = rgu.application_id
and ea.application_id = e.application_id

5. Request Set Details

select rst.USER_REQUEST_SET_NAME,
rs.REQUEST_SET_NAME,
rsst_start.USER_STAGE_NAME start_stage,
rss.DISPLAY_SEQUENCE stage_sequence,
rss.STAGE_NAME,
rss.REQUEST_SET_STAGE_ID,
rss.SUCCESS_LINK,
rss.WARNING_LINK,
rss.ERROR_LINK,
rsst.USER_STAGE_NAME,
rsst.DESCRIPTION stage_description,
rsp.sequence program_sequence,
cp.user_concurrent_program_name,
pa.*
from applsys.fnd_request_sets_tl rst,
applsys.fnd_request_sets rs,
applsys.fnd_request_set_stages_tl rsst_start,
applsys.fnd_request_set_stages rss,
applsys.fnd_request_set_stages_tl rsst,
applsys.fnd_request_set_programs rsp,
applsys.fnd_concurrent_programs_tl cp,
applsys.fnd_request_set_program_args pa
where rs.REQUEST_SET_NAME like '%' -- Enter Request Set Name
and rs.application_id = rst.application_id
and rs.REQUEST_SET_ID = rst.REQUEST_SET_ID
and rst.language = sys_context('USERENV', 'LANG')
and rsst_start.SET_APPLICATION_ID = rs.application_id
and rsst_start.REQUEST_SET_ID = rs.REQUEST_SET_ID
and rsst_start.REQUEST_SET_STAGE_ID = rs.START_STAGE
and rsst_start.language = 'US'
and rss.SET_APPLICATION_ID = rs.application_id
and rss.REQUEST_SET_ID = rs.REQUEST_SET_ID
and rsst.SET_APPLICATION_ID = rss.SET_APPLICATION_ID
and rsst.REQUEST_SET_ID = rss.REQUEST_SET_ID
and rsst.REQUEST_SET_STAGE_ID = rss.REQUEST_SET_STAGE_ID
and rsst.language = 'US'
and rsp.SET_APPLICATION_ID = rss.SET_APPLICATION_ID
and rsp.REQUEST_SET_ID = rss.REQUEST_SET_ID
and rsp.REQUEST_SET_STAGE_ID = rss.REQUEST_SET_STAGE_ID
and rsp.program_application_id = cp.application_id
and rsp.concurrent_program_id = cp.concurrent_program_id
and cp.language = 'US'
and pa.application_id (+) = rsp.SET_APPLICATION_ID
and pa.REQUEST_SET_ID (+) = rsp.REQUEST_SET_ID
and pa.REQUEST_SET_PROGRAM_ID (+) = rsp.REQUEST_SET_PROGRAM_ID
order by rst.USER_REQUEST_SET_NAME, rss.DISPLAY_SEQUENCE, rsp.sequence,
pa.DESCRIPTIVE_FLEX_APPL_ID, pa.DESCRIPTIVE_FLEXFIELD_NAME, pa.APPLICATION_COLUMN_NAME


1.Find Locks Info

SELECT sid, id1, id2, lmode, request, block
FROM v$lock
WHERE sid = &sid

2.Find Session Info

SELECT module, action, sid, serial# from v$session
where action like '%%'

3.Find Lock Mode

select a.sid, b.name, a.id1, a.lmode, a.request from v$lock a, sys.obj$ b
where b.obj# = a.id1

4.Find Locked Objects

select oracle_username, os_user_name, session_id, process,
locked_mode, o.owner, o.object_type, o.object_name
from v$locked_object l,
sys.dba_objects o
where l.object_id = o.object_id
order by o.owner, o.object_name, session_id

5.Control File Query

select * from v$controlfile

6.Folder Info Query

SELECT b.application_short_name,
d.responsibility_name,
a.OBJECT,
c.NAME Folder_Name
FROM apps.fnd_default_folders a,
apps.fnd_application b,
apps.fnd_folders c,
apps.fnd_responsibility_vl d
WHERE a.application_id = b.application_id
AND a.folder_id = c.folder_id
AND d.responsibility_id = - (a.user_id)
AND d.responsibility_name LIKE '%%'
ORDER BY b.application_short_name,
d.responsibility_name;