ORACLE Apps DBA Scripts
ORACLE Apps DBA Scripts
ORACLE Apps DBA Scripts
################################################################################
####################################
###### How to find out responsibility attache
d for particular user ######
################################################################################
####################################
SELECT fu.USER_NAME,fu.DESCRIPTION,frt.RESPONSIBILITY_NAME, furg.end_date
FROM
fnd_user_resp_groups furg,
FND_RESPONSIBILITY fr,
fnd_responsibility_tl frt,
fnd_user fu
WHERE fu.user_name = 'IV624'
AND fu.user_id = furg.user_id
AND furg.responsibility_id = fr.RESPONSIBILITY_ID
AND frt.responsibility_id = fr.RESPONSIBILITY_ID
ORDER BY 1;
SELECT distinct u.user_id, u.user_name user_name,
r.responsibility_name responsiblity,
a.application_name application
FROM fnd_user u,
fnd_user_resp_groups g,
fnd_application_tl a,
fnd_responsibility_tl r
WHERE g.user_id(+) = u.user_id
AND g.responsibility_application_id = a.application_id
AND a.application_id = r.application_id
AND g.responsibility_id = r.responsibility_id
and u.user_name like upper('%&user%')
order by 1;
################################################################################
####################################
###### To check the maintainance mode through sql plus
######
################################################################################
####################################
select REQUEST_ID,
CASE WHEN (PHASE_CODE) = 'C' THEN 'Completed'
WHEN (PHASE_CODE) = 'I' THEN 'Inactive'
WHEN (PHASE_CODE) = 'P' THEN 'Pending'
WHEN (PHASE_CODE) = 'R' THEN 'Running'
ELSE 'NODATA'
END AS PHASE,
CASE WHEN (STATUS_CODE) = 'A' THEN 'Waiting'
WHEN (STATUS_CODE) = 'B' THEN 'Resuming'
WHEN (STATUS_CODE) = 'C' THEN 'Normal'
WHEN (STATUS_CODE) = 'D' THEN 'Cancelled'
WHEN (STATUS_CODE) = 'E' THEN 'Error'
WHEN (STATUS_CODE) = 'F' THEN 'Scheduled'
WHEN (STATUS_CODE) = 'G' THEN 'Warning'
WHEN (STATUS_CODE) = 'H' THEN 'Hold'
WHEN (STATUS_CODE) = 'I' THEN 'Normal'
WHEN (STATUS_CODE) = 'M' THEN 'No Manager'
WHEN (STATUS_CODE) = 'Q' THEN 'Standby'
WHEN (STATUS_CODE) = 'R' THEN 'Normal'
WHEN (STATUS_CODE) = 'S' THEN 'Suspended'
WHEN (STATUS_CODE) = 'T' THEN 'Terminating'
WHEN (STATUS_CODE) = 'U' THEN 'Disabled'
WHEN (STATUS_CODE) = 'W' THEN 'Paused'
WHEN (STATUS_CODE) = 'X' THEN 'Terminated'
WHEN (STATUS_CODE) = 'Z' THEN 'Waiting'
ELSE 'NODATA'
END AS STATUS
from fnd_concurrent_requests where REQUEST_ID=&REQ_ID;
/fs03/MRGOLD/patches/WMS_PATCH/6957082
To Find out the Workflow Mailer component status from DATABASE using sqlplus
select COMPONENT_NAME , STARTUP_MODE, COMPONENT_STATUS
from fnd_svc_components where concurrent_queue_id in (select concurrent_queue_id
from fnd_concurrent_queues where concurrent_queue_name like 'WF%')
order by COMPONENT_TYPE, COMPONENT_ID
/* Query to find out if any patch except localisation patch is applied or not, i
f applied, that what all drivers it contain and time of it s application*/
SELECT A.APPLIED_PATCH_ID,
A.PATCH_NAME,
A.PATCH_TYPE,
B.PATCH_DRIVER_ID,
B.DRIVER_FILE_NAME,
B.ORIG_PATCH_NAME,
B.CREATION_DATE,
B.PLATFORM,
B.SOURCE_CODE,
B.CREATION_DATE,
B.FILE_SIZE,
B.MERGED_DRIVER_FLAG,
B.MERGE_DATE
FROM AD_APPLIED_PATCHES A,
AD_PATCH_DRIVERS B
WHERE A.APPLIED_PATCH_ID = B.APPLIED_PATCH_ID
AND A.PATCH_NAME = '&patch';
################################################################################
####################################
###### 4) To check profile exists or not
######
################################################################################
####################################
select PROFILE_OPTION_NAME,PROFILE_OPTION_ID,USER_PROFILE_OPTION_NAME from FND_
PROFILE_OPTIONS_VL where
UPPER(PROFILE_OPTION_NAME) like upper('%&profile_name%')
--or upper(USER_PROFILE_OPTION_NAME) like upper('%&&profile_name')
################################################################################
####################################
###### 5) for finding look up application
######
################################################################################
####################################
select APPLICATION_SHORT_NAME,LOOKUP_TYPE from FND_LOOKUP_TYPES,fnd_application
where LOOKUP_TYPE like '&LOOKUP_NAME'
and FND_LOOKUP_TYPES.APPLICATION_ID = fnd_application.APPLICATION_ID
################################################################################
####################################
##################Find out functions attached to Respective responsibilities.
##################
################################################################################
####################################
declare
v varchar2(100);
begin
for c1 in (select responsibility_id,RESPONSIBILITY_NAME from fnd_responsibility_
vl where CREATION_DATE > '01-JUN-2010' and RESPONSIBILITY_NAME like 'DEP%')
loop
dbms_output.put_line(c1.RESPONSIBILITY_NAME);
for c2 in (
SELECT prompt
FROM (SELECT menu_id, sub_menu_id, function_id,
LPAD (' ', (LEVEL - 1) * 2) || prompt prompt,
entry_sequence
FROM fnd_menu_entries_vl fme
WHERE prompt IS NOT NULL
AND not exists (
SELECT 1
FROM fnd_resp_functions
WHERE rule_type = 'M' AND application_i
d = 385 AND action_id = menu_id AND responsibility_id = c1.responsibility_id )
AND not exists (
SELECT 1
FROM fnd_resp_functions
WHERE rule_type = 'F' AND application_i
d = 385 AND action_id = function_id AND responsibility_id = c1.responsibility_i
d )
CONNECT BY PRIOR sub_menu_id = menu_id
START WITH menu_id =
(SELECT b.menu_id
FROM fnd_responsibility_vl a, fnd_menus b
WHERE responsibility_id = c1.responsibility_id
AND a.menu_id = b.menu_id
)
AND prompt IS NOT NULL
AND grant_flag = 'Y'
ORDER BY entry_sequence) a
CONNECT BY PRIOR sub_menu_id = menu_id
START WITH menu_id =
(SELECT b.menu_id
FROM fnd_responsibility_vl a, fnd_menus b
WHERE responsibility_id = c1.responsibility_id
AND a.menu_id = b.menu_id
) /*like INV_NAVIGATE*/
AND prompt IS NOT NULL)
loop
dbms_output.put_line(' '||c2.prompt);
end loop;
dbms_output.put_line(c1.RESPONSIBILITY_NAME);
dbms_output.put_line(' END OF Responsibility');
end loop;
end;
/
################################################################################
####################################
################## Find menu and submenus attached to given responsibility
##################
################################################################################
####################################
declare
v varchar2(100);
begin
for c1 in (select responsibility_id,RESPONSIBILITY_NAME from fnd_responsibility_
vl where CREATION_DATE > '01-JUN-2010' and RESPONSIBILITY_NAME like 'DEP Despatc
h Superuser Mobile')
loop
dbms_output.put_line(c1.RESPONSIBILITY_NAME);
for c2 in (
SELECT prompt1, prompt
FROM (SELECT fme.menu_id, sub_menu_id,USER_MENU_NAME prompt1,LPAD (' ', (L
EVEL - 1) * 2) || MENU_NAME prompt
frOM fnd_menu_entries_vl fme,
fnd_menus_vl fmv
WHERE prompt IS NOT NULL
AND fme.sub_menu_id=fmv.menu_id
CONNECT BY PRIOR sub_menu_id = fme.menu_id
START WITH fme.menu_id =
(SELECT b.menu_id
FROM fnd_responsibility_vl a, fnd_menus b
WHERE responsibility_id = c1.responsibility_id
AND a.menu_id = b.menu_id)
) a
CONNECT BY PRIOR sub_menu_id = menu_id
START WITH menu_id =
(SELECT b.menu_id
FROM fnd_responsibility_vl a, fnd_menus b
WHERE responsibility_id = c1.responsibility_id
AND a.menu_id = b.menu_id
) /*like INV_NAVIGATE*/
-- AND prompt IS NOT NULL
)
loop
dbms_output.put_line(c2.prompt1 ||' '||c2.prompt);
end loop;
dbms_output.put_line(c1.RESPONSIBILITY_NAME);
dbms_output.put_line(' END OF Responsibility');
end loop;
end;
/
################################################################################
####################################
######### Find menu and submenus attached to given responsibility with level de
tail number ##################
################################################################################
####################################
declare
v varchar2(100);
begin
for c1 in (select responsibility_id,RESPONSIBILITY_NAME from fnd_responsibility_
vl where CREATION_DATE > '01-JUN-2010' and RESPONSIBILITY_NAME like 'DEP%Mobile'
)
loop
dbms_output.put_line(c1.RESPONSIBILITY_NAME);
for c2 in (
SELECT prompt1,level, prompt
FROM (SELECT fme.menu_id, sub_menu_id,USER_MENU_NAME prompt1,MENU_NAME pro
mpt, LEVEL
frOM fnd_menu_entries_vl fme,
fnd_menus_vl fmv
WHERE prompt IS NOT NULL
AND fme.sub_menu_id=fmv.menu_id
CONNECT BY PRIOR sub_menu_id = fme.menu_id
START WITH fme.menu_id =
(SELECT b.menu_id
FROM fnd_responsibility_vl a, fnd_menus b
WHERE responsibility_id = c1.responsibility_id
AND a.menu_id = b.menu_id)
) a
CONNECT BY PRIOR sub_menu_id = menu_id
START WITH menu_id =
(SELECT b.menu_id
FROM fnd_responsibility_vl a, fnd_menus b
WHERE responsibility_id = c1.responsibility_id
AND a.menu_id = b.menu_id
) /*like INV_NAVIGATE*/
-- AND prompt IS NOT NULL
)
loop
DBMS_OUTPUT.ENABLE(10000);
dbms_output.put_line(C2.LEVEL||' '||c2.prompt );
end loop;
dbms_output.put_line(c1.RESPONSIBILITY_NAME);
dbms_output.put_line(' END OF Responsibility');
end loop;
end;
/
################################################################################
####################################
###### 6) To check the timeline of the reques
t
######
################################################################################
####################################
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_dat
e ) * 24, 2 ) duration
FROM fnd_concurrent_requests
WHERE request_id = TO_NUMBER('&p_request_id');
################################################################################
####################################
###### 6) Find Trace File Name
######
################################################################################
####################################
prompt
accept request prompt 'Please enter the concurrent request id for the appropriat
e concurrent program:'
prompt
column traceid format a8
column tracename format a80
column user_concurrent_program_name format a40
column execname format a15
column enable_trace format a12
set lines 80
set pages 22
set head off
SELECT 'Request id: '||request_id ,
'Trace id: '||oracle_Process_id,
'Trace Flag: '||req.enable_trace,
'Trace Name:
'||dest.value||'/'||lower(dbnm.value)||'_ora_'||oracle_process_id||'.trc',
'Prog. Name: '||prog.user_concurrent_program_name,
'File Name: '||execname.execution_file_name|| execname.subroutine_name ,
'Status : '||decode(phase_code,'R','Running')
||'-'||decode(status_code,'R','Normal'),
'SID Serial: '||ses.sid||','|| ses.serial#,
'Module : '||ses.module
from fnd_concurrent_requests req, v$session ses, v$process proc,
v$parameter dest, v$parameter dbnm, fnd_concurrent_programs_vl prog,
fnd_executables execname
where req.request_id = &request
and req.oracle_process_id=proc.spid(+)
and proc.addr = ses.paddr(+)
and dest.name='user_dump_dest'
and dbnm.name='db_name'
and req.concurrent_program_id = prog.concurrent_program_id
and req.program_application_id = prog.application_id
and prog.application_id = execname.application_id
and prog.executable_id=execname.executable_id;
################################################################################
####################################
###### 7) DEV60cgi/f60cgi login
######
################################################################################
####################################
7) DEV60cgi/f60cgi login
To enable DEV60cgi/f60cgi login
java oracle.apps.fnd.security.AdminAppServer apps/sysappsmay10 AUTHENTICATION O
FF DBC=ukcrp5.dbc
To disable DEV60cgi/f60cgi login
java oracle.apps.fnd.security.AdminAppServer apps/sysappsmay10 AUTHENTICATION
SECURE DBC=ukcrp5.dbc
To check status of DEV60cgi/f60cgi login
select REQUEST_GROUP_NAME,responsibility_name,APPLICATION_SHORT_NAME
from fnd_responsibility fr, fnd_request_groups frg, fnd_responsibility_tl frt, f
nd_application fa
where upper(responsibility_name) LIKE upper('%&resp_name%')
AND frt.RESPONSIBILITY_ID=fr.RESPONSIBILITY_ID
and fr.REQUEST_GROUP_ID = frg.REQUEST_GROUP_ID
and fa.application_id=fr.application_id
SELECT responsibility_name,
menu_name,
USER_MENU_NAME,
RESPONSIBILITY_KEY,
APPLICATION_SHORT_NAME RESP_APPLICATION_NAME,
REQUEST_GROUP_NAME,
APPLICATION_SHORT_NAME REQ_APPLICATION_NAME
FROM fnd_responsibility_tl frt,
fnd_responsibility fr ,
fnd_application fa,
fnd_menus fm,
fnd_menus_tl fmt,
fnd_request_groups frg
WHERE fr.CREATION_DATE like '%JUN-10'
and upper(responsibility_name) LIKE upper('DEP%')
AND frt.RESPONSIBILITY_ID=fr.RESPONSIBILITY_ID
AND fr.APPLICATION_ID =fa.APPLICATION_ID
AND frt.RESPONSIBILITY_ID=fr.RESPONSIBILITY_ID
AND fr.menu_id = fmt.menu_id
AND fm.menu_id = fmt.menu_id
AND fr.REQUEST_GROUP_ID = frg.REQUEST_GROUP_ID
AND fa.application_id =fr.application_id
AND frt.RESPONSIBILITY_ID=fr.RESPONSIBILITY_ID