35224705 Oracle Apps DBA Scripts

11
ndex 1) How to find out responsibility attached for particular user 2) To check the maintainance mode through sql plus 3) To clear FND_NODEs 4) To check profile exists or not 5) for finding look up application 6)To check the timeline of the request : 7) DEV60cgi/f60cgi login 8) To find out trace file for particular request id from backend 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'); ################################################################################ #################################### ###### Lookup info with APplication name ###### ################################################################################ #################################### select a.LOOKUP_TYPE,a.VIEW_APPLICATION_ID,b.application_name, b.application_sho rt_name from FND_LOOKUP_TYPES_TL a, fnd_application_vl b where a.VIEW_APPLICATION_ID = b.APPLICATION_ID and LOOKUP_TYPE like upper('%&lookup%') ################################################################################ #################################### ###### 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

Transcript of 35224705 Oracle Apps DBA Scripts

Page 1: 35224705 Oracle Apps DBA Scripts

ndex1) How to find out responsibility attached for particular user2) To check the maintainance mode through sql plus3) To clear FND_NODEs4) To check profile exists or not5) for finding look up application6)To check the timeline of the request :7) DEV60cgi/f60cgi login8) To find out trace file for particular request id from backend 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_date ) * 24, 2 ) durationFROM fnd_concurrent_requestsWHERE request_id = TO_NUMBER('&p_request_id'); ########################################################################################################################## Lookup info with APplication name ##########################################################################################################################select a.LOOKUP_TYPE,a.VIEW_APPLICATION_ID,b.application_name, b.application_short_name from FND_LOOKUP_TYPES_TL a, fnd_application_vl b where a.VIEW_APPLICATION_ID = b.APPLICATION_IDand LOOKUP_TYPE like upper('%&lookup%')

########################################################################################################################## How to find out responsibility attached for particular user ##########################################################################################################################SELECT fu.USER_NAME,fu.DESCRIPTION,frt.RESPONSIBILITY_NAME, furg.end_dateFROMfnd_user_resp_groups furg,FND_RESPONSIBILITY fr,fnd_responsibility_tl frt,fnd_user fuWHERE fu.user_name = 'IV624'AND fu.user_id = furg.user_idAND furg.responsibility_id = fr.RESPONSIBILITY_IDAND frt.responsibility_id = fr.RESPONSIBILITY_IDORDER BY 1;

SELECT distinct u.user_id, u.user_name user_name,r.responsibility_name responsiblity,a.application_name applicationFROM fnd_user u,fnd_user_resp_groups g,fnd_application_tl a,fnd_responsibility_tl rWHERE g.user_id(+) = u.user_idAND g.responsibility_application_id = a.application_idAND a.application_id = r.application_id

Page 2: 35224705 Oracle Apps DBA Scripts

AND g.responsibility_id = r.responsibility_idand u.user_name like upper('%&user%')order by 1;

########################################################################################################################## To check the maintainance mode through sql plus ##########################################################################################################################

select FND_PROFILE.VALUE('APPS_MAINTENANCE_MODE')from dual########################################################################################################################## To Clear nodes from FND_NODES ##########################################################################################################################XEC FND_CONC_CLONE.SETUP_CLEAN;

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 STATUSfrom 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_STATUSfrom fnd_svc_components where concurrent_queue_id in (select concurrent_queue_id from fnd_concurrent_queues where concurrent_queue_name like 'WF%')

Page 3: 35224705 Oracle Apps DBA Scripts

order by COMPONENT_TYPE, COMPONENT_ID

/* Query to find out if any patch except localisation patch is applied or not, if 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_DATEFROM AD_APPLIED_PATCHES A, AD_PATCH_DRIVERS BWHERE A.APPLIED_PATCH_ID = B.APPLIED_PATCH_IDAND A.PATCH_NAME = '&patch';

/* To know that if the patch is applied successfully, applied on both node or not, start time of patch application and end time of patch application, patch top location , session id � patch run id */ select D.PATCH_NAME, B.APPLICATIONS_SYSTEM_NAME, B.INSTANCE_NAME, B.NAME, C.DRIVER_FILE_NAME, A.PATCH_DRIVER_ID, A.PATCH_RUN_ID, A.SESSION_ID, A.PATCH_TOP, A.START_DATE, A.END_DATE, A.SUCCESS_FLAG, A.FAILURE_COMMENTS from AD_PATCH_RUNS A, AD_APPL_TOPS B, AD_PATCH_DRVIERS C, AD_APPLIED_PATCHES D where A.APPL_TOP_ID = B.APPL_TOP_ID AND A.PATCH_DRIVER_ID = C.PATCH_DRIVER_ID and C.APPLIED_PATCH_ID = D.APPLIED_PATCH_ID and A.PATCH_DRIVER_ID in (select PATCH_DRIVER_ID from AD_PATCH_DRIVERS where APPLIED_PATCH_ID in (select APPLIED_PATCH_ID from AD_APPLIED_PATCHES where PATCH_NAME = �<patch number>�)) ORDER BY 3;

/* To find the latest application version */ select ARU_RELEASE_NAME||�.'||MINOR_VERSION||�.'||TAPE_VERSION version, START_DATE_ACTIVE updated,ROW_SOURCE_COMMENTS �how it is done�, BASE_RELEASE_FLAG �Base version� FROM AD_RELEASES where END_DATE_ACTIVE IS NULL

/* to find the base application version */ select ARU_RELEASE_NAME||�.'||MINOR_VERSION||�.'||TAPE_VERSION version, START_DATE_ACTIVE when updated, ROW_SOURCE_COMMENTS �how it is done� from AD_RELEASES where BASE_RELEASE_FLAG = �Y�

/* To find all available application version */ select ARU_RELEASE_NAME||�.'||MINOR_VERSION||�.'||TAPE_VERSION version, START_DATE_ACTIVE when updated, END_DATE_ACTIVE �when lasted�, CASE WHEN BASE_RELEASE_FLAG = �Y� Then �BASE VERSION� ELSE �Upgrade� END �BASE/UPGRADE�, ROW_SOURCE_COMMENTS �how it is done� fro_RELEASES

/* To get file version of any application file which is changed through patch application */ select A.FILE_ID, A.APP_SHORT_NAME, A.SUBDIR, A.FILENAME, max(B.VERSION) from AD_FILES A, AD_FILE_VERSIONS B where A.FILE_ID = B.FILE_ID and B.FILE_ID = 86291 g

Page 4: 35224705 Oracle Apps DBA Scripts

roup by A.FILE_ID, A.APP_SHORT_NAME, A.SUBDIR, A.FILENAM

/* To get information related to how many time driver file is applied for bugs */ select * from AD_PATCH_RUN_BUGS where BUG_ID in (select BUG_ID from AD_BUGS where BUG_NUMBER = �<BUG NUMBER>�

/* To find latest patchset level for module installed */ select APP_SHORT_NAME, max(PATCH_LEVEL) from AD_PATCH_DRIVER_MINIPKS GROUP BY APP_SHORT_NAME

/* To find what is being done by the patch */ select A.BUG_NUMBER �Patch Number�, B. PATCh_RUN_BUG_ID �Run Id�,D.APP_SHORT_NAME appl_top, D.SUBDIR, D.FILENAME, max(F.VERSION) latest, E.ACTION_CODE action from AD_BUGS A, AD_PATCH_RUN_BUGS B, AD_PATCH_RUN_BUG_ACTIONS C, AD_FILES D, AD_PATCH_COMMON_ACTIONS E, AD_FILE_VERSIONS F where A.BUG_ID = B.BUG_ID and B.PATCH_RUN_BUG_ID = C.PATCH_RUN_BUG_ID and C.FILE_ID = D.FILE_ID and E.COMMON_ACTION_ID = C.COMMON_ACTION_ID and D.FILE_ID = F.FILE_ID and A.BUG_NUMBER = �<patch number>� and B.PATCH_RUN_BUG_ID = � < > � and C.EXECUTED_FLAG = �Y� GROUP BY A.BUG_NUMBER, B.PATCH_RUN_BUG_ID, D. APP_SHORT_NAME, D>SUBDIR, D.FILENAME, E.ACTION_CODE

/* To find Merged patch Information from database in Oracle Applications */ select bug_number from ad_bugs where bug_id in ( select bug_id from ad_comprising_patches where patch_driver_id =(select patch_driver_id from ad_patch_drivers where applied_patch_id =&n) );

/* Second Query to know, what all has been done during application of PATCH */ Select J.PATCh_NAME, H.APPLICATIONS_SYSTEM_NAME Instance_Name, H.NAME, I.DRIVER_FILE_NAME, D.APP_SHORT_NAME appl_top, D.SUBDIR, D.FILENAME, max(F.VERSION) latest, E.ACTION_CODE action from AD_BUGS A, AD_PATCH_RUN_BUGS B, AD_PATCH_RUN_BUG_ACTIONS C, AD_FILES D, AD_PATCH_COMMON_ACTIONS E, AD_FILE_VERSIONS F, AD_PATCH_RUNS G, AD_APPL_TOPS H, AD_PATCH_DRIVERS I, AD_APPLIED_PATCHES J where A.BUG_ID = B.BUG_ID and B.PATCH_RUN_BUG_ID = C.PATCH_RUN_BUG_ID and C.FILE_ID = D.FILE_ID and E.COMMON_ACION_ID = C.COMMON_ACTION_ID and D.FILE_ID = F.FILE_ID and G.APPL_TOP_ID = H.APPL_TOP_ID and G.PATCH_DRIVER_ID = I.PATCH_DRIVER_ID and I.APPLIED_PATCH_ID = J.APPLIED_PATCH_ID and B.PATCH_RUN_ID = G.PATCH_RUN_ID and C.EXECUTED_FLAG = �Y� and G.PATCH_DRIVER_ID in (select PATCH_DRIVER_ID from AD_PATCH_DRIVERS where APPLIED_PATCH_ID in (select APPLIED_PATCH_ID from AD_APPLIED_PATCHES where PATCH_NAME = �<Patch Number>�)) GROUP BY J.PATCH_NAME, H.APPLICATINS_SYSTEM_NAME, H.NAME, I.DRIVER_FILE_BNAME, D.APP_SHORT_NAME, D.SUBDIR, D.FILENAME, E.ACTION_CODE

/* Script to find out Patch level of mini Pack */ Select product_version,patch_level from FND_PROUDCT_INSTALLATIONS where patch_level like �%&shortname%�;

Replace short name by name of Oracle Apps Minipack for which you want to find out Patch level . ex.AD � for Applications DBAGL � for General LedgerPO � Purchase Order

########################################################################################################################## 4) To check profile exists or not ##########################################################################################################################

Page 5: 35224705 Oracle Apps DBA Scripts

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. ######################################################################################################################################

declarev varchar2(100);beginfor c1 in (select responsibility_id,RESPONSIBILITY_NAME from fnd_responsibility_vl where CREATION_DATE > '01-JUN-2010' and RESPONSIBILITY_NAME like 'DEP%')loopdbms_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_id ) 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

Page 6: 35224705 Oracle Apps DBA Scripts

) AND prompt IS NOT NULL AND grant_flag = 'Y'

ORDER BY entry_sequence) aCONNECT BY PRIOR sub_menu_id = menu_idSTART 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 ######################################################################################################################################

declarev varchar2(100);beginfor c1 in (select responsibility_id,RESPONSIBILITY_NAME from fnd_responsibility_vl where CREATION_DATE > '01-JUN-2010' and RESPONSIBILITY_NAME like 'DEP Despatch Superuser Mobile')loopdbms_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 (' ', (LEVEL - 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)

) aCONNECT BY PRIOR sub_menu_id = menu_idSTART WITH menu_id = (SELECT b.menu_id FROM fnd_responsibility_vl a, fnd_menus b

Page 7: 35224705 Oracle Apps DBA Scripts

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 detail number ######################################################################################################################################declarev varchar2(100);beginfor c1 in (select responsibility_id,RESPONSIBILITY_NAME from fnd_responsibility_vl where CREATION_DATE > '01-JUN-2010' and RESPONSIBILITY_NAME like 'DEP%Mobile')loopdbms_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 prompt, 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)

) aCONNECT BY PRIOR sub_menu_id = menu_idSTART 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;

Page 8: 35224705 Oracle Apps DBA Scripts

dbms_output.put_line(c1.RESPONSIBILITY_NAME);dbms_output.put_line(' END OF Responsibility');end loop;end;/

########################################################################################################################## 6) To check the timeline of the request ##########################################################################################################################

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_date ) * 24, 2 ) durationFROM fnd_concurrent_requestsWHERE request_id = TO_NUMBER('&p_request_id');

########################################################################################################################## 6) Find Trace File Name ##########################################################################################################################

prompt accept request prompt 'Please enter the concurrent request id for the appropriate 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

Page 9: 35224705 Oracle Apps DBA Scripts

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 OFF 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

java oracle.apps.fnd.security.AdminAppServer apps/sysappsmay10 STATUS DBC=ukcrp5.dbc

########################################################################################################################## 8) To find out trace file for particular request id from backend ##########################################################################################################################

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.modulefrom fnd_concurrent_requests req, v$session ses, v$process proc,v$parameter dest, v$parameter dbnm, fnd_concurrent_programs_vl prog,fnd_executables execnamewhere req.request_id = &request_idand req.oracle_process_id=proc.spid(+)and proc.addr = ses.paddr(+)

Page 10: 35224705 Oracle Apps DBA Scripts

and dest.name='user_dump_dest'and dbnm.name='db_name'and req.concurrent_program_id = prog.concurrent_program_idand req.program_application_id = prog.application_idand prog.application_id = execname.application_idand prog.executable_id=execname.executable_id;

Queries related to responsibility

SELECT responsibility_name, RESPONSIBILITY_KEY, APPLICATION_SHORT_NAMEFROM fnd_responsibility_tl frt, fnd_responsibility fr , fnd_application faWHERE upper(responsibility_name) LIKE upper('%&resp_name%')AND frt.RESPONSIBILITY_ID=fr.RESPONSIBILITY_IDAND fr.APPLICATION_ID =fa.APPLICATION_ID

select 'mig_aol_gm.sh UKCRP5 ppsmrgld10a UKPRX ' ||'"' ||MENU_NAME || '"'

select menu_name,USER_MENU_NAME,responsibility_name from fnd_menus fm, fnd_menus_tl fmt, fnd_responsibility fr ,fnd_responsibility_tl frtwhere upper(responsibility_name) LIKE upper('%&resp_name%')AND frt.RESPONSIBILITY_ID=fr.RESPONSIBILITY_IDand fr.menu_id = fmt.menu_idand fm.menu_id = fmt.menu_id

select REQUEST_GROUP_NAME,responsibility_name,APPLICATION_SHORT_NAMEfrom fnd_responsibility fr, fnd_request_groups frg, fnd_responsibility_tl frt, fnd_application fawhere upper(responsibility_name) LIKE upper('%&resp_name%')AND frt.RESPONSIBILITY_ID=fr.RESPONSIBILITY_IDand fr.REQUEST_GROUP_ID = frg.REQUEST_GROUP_IDand 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_NAMEFROM fnd_responsibility_tl frt, fnd_responsibility fr , fnd_application fa, fnd_menus fm, fnd_menus_tl fmt, fnd_request_groups frgWHERE fr.CREATION_DATE like '%JUN-10'and upper(responsibility_name) LIKE upper('DEP%')AND frt.RESPONSIBILITY_ID=fr.RESPONSIBILITY_IDAND fr.APPLICATION_ID =fa.APPLICATION_IDAND frt.RESPONSIBILITY_ID=fr.RESPONSIBILITY_ID

Page 11: 35224705 Oracle Apps DBA Scripts

AND fr.menu_id = fmt.menu_idAND fm.menu_id = fmt.menu_idAND fr.REQUEST_GROUP_ID = frg.REQUEST_GROUP_IDAND fa.application_id =fr.application_idAND frt.RESPONSIBILITY_ID=fr.RESPONSIBILITY_ID