DBA Data[Home] [Help]

PACKAGE BODY: APPS.INV_DIAG_OBJ

Source


1 package body INV_DIAG_OBJ as
2 /* $Header: INVDOBJB.pls 120.0.12000000.1 2007/06/22 01:09:11 musinha noship $ */
3 
4 PROCEDURE init is
5 BEGIN
6 null;
7 END init;
8 
9 PROCEDURE cleanup IS
10 BEGIN
11  null;
12 NULL;
13 END cleanup;
14 
15 PROCEDURE runtest(inputs IN  JTF_DIAG_INPUTTBL,
16                         report OUT NOCOPY JTF_DIAG_REPORT,
17                         reportClob OUT NOCOPY CLOB) IS
18  reportStr   LONG;           -- REPORT
19  sqltxt    VARCHAR2(9999);  -- SQL select statement
20  c_username  VARCHAR2(50);   -- accept input for username
21  statusStr   VARCHAR2(50);   -- SUCCESS or FAILURE
22  errStr      VARCHAR2(4000); -- error message
23  fixInfo     VARCHAR2(4000); -- fix tip
24  isFatal     VARCHAR2(50);   -- TRUE or FALSE
25  dummy_num   NUMBER;
26  row_limit   NUMBER;
27  l_org_id    NUMBER;
28  l_script    varchar2(30);
29  l_app_id    NUMBER;
30  l_app       varchar2(50);
31  l_pkg       varchar2(30);
32  l_file      varchar2(30);
33  l_patch     varchar2(100);
34  l_conc_prg  varchar2(30);
35 
36 BEGIN
37 JTF_DIAGNOSTIC_ADAPTUTIL.setUpVars;
38 JTF_DIAGNOSTIC_ADAPTUTIL.addStringToReport('@html');
39 JTF_DIAGNOSTIC_COREAPI.insert_style_sheet;
40 -- accept input
41 l_script :=JTF_DIAGNOSTIC_ADAPTUTIL.getInputValue('CheckName',inputs);
42 l_app_id :=JTF_DIAGNOSTIC_ADAPTUTIL.getInputValue('ApplicationId',inputs);
43 l_pkg :=JTF_DIAGNOSTIC_ADAPTUTIL.getInputValue('Package',inputs);
44 l_file :=JTF_DIAGNOSTIC_ADAPTUTIL.getInputValue('FileName',inputs);
45 l_patch :=JTF_DIAGNOSTIC_ADAPTUTIL.getInputValue('PatchNum',inputs);
46 l_conc_prg :=JTF_DIAGNOSTIC_ADAPTUTIL.getInputValue('ConcurrentProgram',inputs);
47 row_limit :=INV_DIAG_GRP.g_max_row;
48 
49 JTF_DIAGNOSTIC_ADAPTUTIL.addStringToReport(':'||l_org_id||' Check '||l_script||' appId '||l_app_id);
50 JTF_DIAGNOSTIC_COREAPI.BRPrint;
51 
52 if l_app_id is null then
53    select APPLICATION_ID
54      into l_app_id
55      from FND_APPLICATION
56     where APPLICATION_SHORT_NAME='INV';
57     reportStr := ' INV';
58     l_app :='INV';
59 else
60    select trim(APPLICATION_SHORT_NAME)
61      into l_app
62      from FND_APPLICATION
63     where APPLICATION_ID=l_app_id;
64     reportStr := ' '||l_app;
65 end if;
66 
67 if l_script = 'invalid' then
68     sqltxt := 'SELECT owner "Owner", object_name "Name", object_type "Type" '||
69               '   , status "Status", TO_CHAR( last_ddl_time, ''DD-MON-RR'' ) "Last Compile Date" '||
70               '   , TO_CHAR( created, ''DD-MON-RR'' ) "Creation Date"  '||
71               'FROM dba_objects WHERE owner = ''APPS'' and status=''INVALID'' AND  '||
72               '    ( object_name LIKE ''INV%'' OR '||
73               '      object_name LIKE ''MTL%'' OR '||
74               '      object_name LIKE '''||l_app||'%'' OR '||
75               '      object_name IN ( ''LOT_SPLIT_DATA_INSERT'' , ''ORG_FREIGHT_TL_PKG'' , '||
76               '                       ''PERIOD_SUMMARY_TRANSFER_UTIL'' , ''RMA_UPDATE'' ,'||
77               '                       ''RMA_UPDATE'' , ''LOT_SPLIT_DATA_INSERT'' , '||
78               '                       ''SERIAL_CHECK'' , ''MISC_TRANSACTIONS_UTIL'', '||
79               '                       ''USER_PKG_LOT'' )  )  '||
80               'ORDER BY object_name, object_type';
81     if l_app_id <> 401 then
82        reportStr :=' and '||l_app;
83     end if;
84     dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt,'Invalid database objects related to INV'||reportStr);
85 
86 elsif l_script ='profile' then
87    sqltxt :='SELECT b.user_profile_option_name "Long Name"  '||
88             '   , a.profile_option_name "Short Name"  '||
89             '   , DECODE( c.level_id, 10001, ''Site''  '||
90             '                       , 10002, ''Application''  '||
91             '                       , 10003, ''Responsibility''  '||
92             '                       , 10004, ''User''  '||
93             '                       , ''Unknown'') "Level"  '||
94             '   , DECODE( c.level_id, 10001, ''Site''  '||
95             '             , 10002, NVL(h.application_short_name,to_char(c.level_value))  '||
96             '             , 10003, NVL(g.responsibility_name,to_char(c.level_value))  '||
97             '             , 10004, NVL(e.user_name,to_char(c.level_value))  '||
98             '             , ''Unknown'') "Level Value"  '||
99             '   , c.profile_option_value "Profile Value"  '||
100             '   , c.profile_option_id "Profile ID"  '||
101             '   , TO_CHAR( c.last_update_date , ''DD-MON-RR HH24:MI'' ) "Updated Date"   '||
102             '   , NVL(d.user_name, TO_CHAR(c.last_updated_by)) "Updated By"  '||
103             ' FROM fnd_profile_options a  '||
104             '    , fnd_profile_options_vl b  '||
105             '    , fnd_profile_option_values c  '||
106             '    , fnd_user d  '||
107             '    , fnd_user e  '||
108             '    , fnd_responsibility_vl g  '||
109             '    , fnd_application h  '||
110             'WHERE a.application_id = '||l_app_id||
111             ' AND a.profile_option_name = b.profile_option_name  '||
112             ' AND a.profile_option_id = c.profile_option_id  '||
113             ' AND a.application_id = c.application_id  '||
114             ' AND c.last_updated_by = d.user_id (+)  '||
115             ' AND c.level_value = e.user_id (+)  '||
116             ' AND c.level_value = g.responsibility_id (+)  '||
117             ' AND c.level_value = h.application_id (+)  '||
118             'ORDER BY b.user_profile_option_name, c.level_id, c.profile_option_value';
119 
120    dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt,'Profileoptions and settings for applicationId '||l_app_id);
121 
122 elsif l_script = 'version' then
123 
124    if l_pkg is not null then
125       sqltxt := ' select text "Package(Spec/Body)" from dba_source where owner =''APPS'' and name= upper('''||l_pkg||''') and line=2';
126       dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt,'Version of the package '||l_pkg);
127    elsif l_file is null then
128       sqltxt := ' select name "Package(Spec/Body)", text "File Info" from dba_source where owner =''APPS'' and name like '''||l_app||'_%'' and line=2 order by name';
129       dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt,'Version of all packages from application '||l_app);
130    end if;
131 
132    if l_file is not null then
133       sqltxt := ' select f.filename Name, subdir Directory, version'||
134                 ' from ad_file_versions v, ad_files f'||
135                 ' where v.file_id=f.file_id'||
136                 ' and file_version_id='||
137                 '  (select max(fv.file_version_id)'||
138                 '  from ad_file_versions fv'||
139                 '  where fv.file_id=v.file_id) '||
140                 ' and f.filename like '''||l_file||'%''';
141       dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt,'Latest Patched Version of the file: '||l_pkg);
142    elsif l_pkg is null then
143       sqltxt := ' select f.filename Name, subdir Directory, version'||
144                 ' from ad_file_versions v, ad_files f'||
145                 ' where v.file_id=f.file_id'||
146                 ' and file_version_id='||
147                 '  (select max(fv.file_version_id)'||
148                 '  from ad_file_versions fv'||
149                 '  where fv.file_id=v.file_id) '||
150                 ' and subdir like ''forms%'' '||
151                 ' and f.app_short_name = '''||l_app||''''||
152                 ' order by subdir, f.last_update_date';
153       dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt,'Latest Patched Forms from Application: '||l_app);
154 
155       sqltxt := ' select f.filename Name, subdir Directory, version'||
156                 ' from ad_file_versions v, ad_files f'||
157                 ' where v.file_id=f.file_id'||
158                 ' and file_version_id='||
159                 '  (select max(fv.file_version_id)'||
160                 '  from ad_file_versions fv'||
161                 '  where fv.file_id=v.file_id) '||
162                 ' and subdir = ''resource'' '||
163                 ' and f.app_short_name = '''||l_app||''''||
164                 ' order by subdir, f.last_update_date';
165       dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt,'Latest Patched Libraries from Application: '||l_app);
166 
167       sqltxt := ' select f.filename Name, subdir Directory, version'||
168                 ' from ad_file_versions v, ad_files f'||
169                 ' where v.file_id=f.file_id'||
170                 ' and file_version_id='||
171                 '  (select max(fv.file_version_id)'||
172                 '  from ad_file_versions fv'||
173                 '  where fv.file_id=v.file_id) '||
174                 ' and subdir like ''java%'' '||
175                 ' and f.app_short_name = '''||l_app||''''||
176                 ' order by subdir, f.last_update_date';
177       dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt,'Latest Patched Java Classes from Application: '||l_app);
178 
179       sqltxt := ' select f.filename Name, subdir Directory, version'||
180                 ' from ad_file_versions v, ad_files f'||
181                 ' where v.file_id=f.file_id'||
182                 ' and file_version_id='||
183                 '  (select max(fv.file_version_id)'||
184                 '  from ad_file_versions fv'||
185                 '  where fv.file_id=v.file_id) '||
186                 ' and subdir = ''patch/115/odf'' '||
187                 ' and f.app_short_name = '''||l_app||''''||
188                 ' order by subdir, f.last_update_date';
189       dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt,'Latest Patched odf files from Application: '||l_app);
190 
191       sqltxt := ' select f.filename Name, subdir Directory, version'||
192                 ' from ad_file_versions v, ad_files f'||
193                 ' where v.file_id=f.file_id'||
194                 ' and file_version_id='||
195                 '  (select max(fv.file_version_id)'||
196                 '  from ad_file_versions fv'||
197                 '  where fv.file_id=v.file_id) '||
198                 ' and subdir like ''reports%'' '||
199                 ' and f.app_short_name = '''||l_app||''''||
200                 ' order by subdir, f.last_update_date';
201       dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt,'Latest Patched Reports from Application: '||l_app);
202    end if;
203 
204 elsif l_script = 'lock' then
205    sqltxt :='select a.*,b.module,p.spid from (select s.sid,to_char(s.logon_time,''DD-MON-YY HH:MI:SS'') logon_time, s.serial#,'||
206             '       decode(s.process, null,'||
207             '          decode(substr(p.username,1,1), ''?'',   upper(s.osuser), p.username),'||
208             '          decode(       p.username, ''ORACUSR '', upper(s.osuser), s.process)'||
209             '       ) process,'||
210             '       nvl(s.username, ''SYS (''||substr(p.username,1,4)||'')'') username,'||
211             '       decode(l.type,'||
212             '              ''TM'', ''DML/DATA ENQ'',   ''TX'', ''TRANSAC ENQ'','||
213             '              ''UL'', ''PLS USR LOCK'','||
214             '              ''BL'', ''BUF HASH TBL'',  ''CF'', ''CONTROL FILE'','||
215             '              ''CI'', ''CROSS INST F'',  ''DF'', ''DATA FILE   '','||
216             '              ''CU'', ''CURSOR BIND '','||
217             '              ''DL'', ''DIRECT LOAD '',  ''DM'', ''MOUNT/STRTUP'','||
218             '              ''DR'', ''RECO LOCK   '',  ''DX'', ''DISTRIB TRAN'','||
219             '              ''FS'', ''FILE SET    '',  ''IN'', ''INSTANCE NUM'','||
220             '              ''FI'', ''SGA OPN FILE'','||
221             '              ''IR'', ''INSTCE RECVR'',  ''IS'', ''GET STATE   '','||
222             '              ''IV'', ''LIBCACHE INV'',  ''KK'', ''LOG SW KICK '','||
223             '              ''LS'', ''LOG SWITCH  '','||
224             '              ''MM'', ''MOUNT DEF   '',  ''MR'', ''MEDIA RECVRY'','||
225             '              ''PF'', ''PWFILE ENQ  '',  ''PR'', ''PROCESS STRT'','||
226             '              ''RT'', ''REDO THREAD '',  ''SC'', ''SCN ENQ     '','||
227             '              ''RW'', ''ROW WAIT    '','||
228             '              ''SM'', ''SMON LOCK   '',  ''SN'', ''SEQNO INSTCE'','||
229             '              ''SQ'', ''SEQNO ENQ   '',  ''ST'', ''SPACE TRANSC'','||
230             '              ''SV'', ''SEQNO VALUE '',  ''TA'', ''GENERIC ENQ '','||
231             '              ''TD'', ''DLL ENQ     '',  ''TE'', ''EXTEND SEG  '','||
232             '              ''TS'', ''TEMP SEGMENT'',  ''TT'', ''TEMP TABLE  '','||
233             '              ''UN'', ''USER NAME   '',  ''WL'', ''WRITE REDO  '','||
234             '              ''TYPE=''||l.type) type,'||
235             '       decode(l.lmode, 0, ''NONE'', 1, ''NULL'', 2, ''RS'', 3, ''RX'','||
236             '               4, ''S'',    5, ''RSX'',  6, ''X'','||
237             '               to_char(l.lmode) ) lmode,'||
238             '       decode(l.request, 0, ''NONE'', 1, ''NULL'', 2, ''RS'', 3, ''RX'','||
239             '               4, ''S'', 5, ''RSX'', 6, ''X'','||
240             '               to_char(l.request) ) lrequest,'||
241             '       decode(l.type, ''MR'', decode(u.name, null,'||
242             '              ''DICTIONARY OBJECT'', u.name||''.''||o.name),'||
243             '              ''TD'', u.name||''.''||o.name,'||
244             '              ''TM'', u.name||''.''||o.name,'||
245             '              ''RW'', ''FILE#=''||substr(l.id1,1,3)||'||
246             '              '' BLOCK#=''||substr(l.id1,4,5)||'' ROW=''||l.id2,'||
247             '              ''TX'', ''RS+SLOT#''||l.id1||'' WRP#''||l.id2,'||
248             '              ''WL'', ''REDO LOG FILE#=''||l.id1,'||
249             '              ''RT'', ''THREAD=''||l.id1,'||
250             '              ''TS'', decode(l.id2, 0, ''ENQUEUE'','||
251             '                                     ''NEW BLOCK ALLOCATION''),'||
252             '              ''ID1=''||l.id1||'' ID2=''||l.id2) object'||
253             ' from   sys.v_$lock l, sys.v_$session s, sys.obj$ o, sys.user$ u,'||
254             '       sys.v_$process p'||
255             ' where  s.paddr  = p.addr(+)'||
256             '  and  l.sid    = s.sid'||
257             '  and  l.id1    = o.obj#(+)'||
258             '  and  o.owner# = u.user#(+)'||
259             '  and  l.type   <> ''MR'''||
260             ' UNION ALL                         '||
261             ' select s.sid,to_char(s.logon_time,''DD-MON-YY HH:MI:SS'') logon_time, s.serial#, s.process, s.username, '||
262             '       ''LATCH'', ''X'', ''NONE'', h.name||'' ADDR=''||rawtohex(laddr)'||
263             ' from   sys.v_$process p, sys.v_$session s, sys.v_$latchholder h'||
264             ' where  h.pid  = p.pid'||
265             '  and  p.addr = s.paddr'||
266             ' UNION ALL'||
267             ' select s.sid,to_char(s.logon_time,''DD-MON-YY HH:MI:SS'') logon_time, s.serial#, s.process, '||
268             ' s.username, ''LATCH'', ''NONE'', ''X'', name||'' LATCH=''||p.latchwait'||
269             ' from   sys.v_$session s, sys.v_$process p, sys.v_$latch l'||
270             ' where  latchwait is not null'||
271             '  and  p.addr      = s.paddr'||
272             '  and  p.latchwait = l.addr) a , v$session b,v$process p where'||
273             ' a.sid=b.sid and a.object like ''%MTL%'' and b.paddr = p.addr(+)';
274 
275    sqltxt := 'select * from ('||sqltxt||') WHERE ROWNUM <= '||row_limit;
276    dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt,'Display database locks and latches');
277 
278 elsif l_script = 'patch' then
279    sqltxt := 'select patch_name, patch_type , max(creation_date) "Applied Date" from ad_applied_patches ';
280    if l_patch is not null then
281       sqltxt := sqltxt||' where patch_name= '''||l_patch||'''';
282    end if;
283    sqltxt := sqltxt||' group by  patch_name, patch_type  order by max(creation_date) desc';
284 
285    dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt,'Display applied patch '||l_patch);
286 
287 elsif l_script ='manager' then
288    sqltxt :='SELECT  fa.application_name "Application Name"  '||
289             '     , fa.application_short_name "Application|Shortname"  '||
290             '     , fcp.concurrent_processor_name "Name"  '||
291             '     , fcq.user_concurrent_queue_name "Manager"  '||
292             '     , NVL( fcq.target_node,''n/a'') "Node"  '||
293             '     , fcq.running_processes "Actual"  '||
294             '     , fcq.max_processes "Target"  '||
295             ' FROM fnd_concurrent_queues_vl fcq  '||
296             '     , fnd_application_vl fa  '||
297             '     , fnd_concurrent_processors fcp '||
298             'WHERE fa.application_id = fcq.application_id  '||
299             '  AND fcq.application_id = fcp.application_id  '||
300             '  AND fcq.concurrent_processor_id = fcp.concurrent_processor_id  '||
301             '  AND fa.application_short_name IN ( ''INV'' )  '||
302             'ORDER BY fcp.application_id DESC  '||
303             ', fcp.concurrent_processor_id  '||
304             ', fcp.concurrent_processor_name';
305 
306    dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt, 'Concurrent Managers related to Inventory');
307    sqltxt :='SELECT PROCESS_TYPE "Manager"  '||
308             '    , PROCESS_NAME "Internal|Name"  '||
309             '    , WORKER_ROWS "Worker|Rows"  '||
310             '    , TIMEOUT_HOURS || '':'' || TIMEOUT_MINUTES "Timeout|Hrs:Min"  '||
311             '    , PROCESS_HOURS || '':'' || PROCESS_MINUTES || '':'' || PROCESS_SECONDS "Process Interval|Hrs:Min:Sec"  '||
312             '    , MANAGER_PRIORITY "Manager|Priority"  '||
313             '    , WORKER_PRIORITY "Worker|Priority"  '||
314             '    , PROCESSING_TIMEOUT "Processing|Timeout"  '||
315             '    , PROCESS_CODE'||
316             '    , PROCESS_APP_SHORT_NAME'||
317             ' FROM mtl_interface_proc_controls_v  '||
318             'ORDER BY process_type ' ;
319    dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt, 'Configuration of the INV Txn Manager');
320 
321    if l_conc_prg is not null then
322        sqltxt :=' SELECT request_id "Request"  '||
323                 '      , fcp.concurrent_program_name "Concurrent Program"  '||
324                 '      , DECODE( phase_code, ''C'', ''Completed'',  '||
325                 '                            ''I'', ''Inactive'',  '||
326                 '                            ''P'', ''Pending'',  '||
327                 '                            ''R'', ''Running'',  '||
328                 '                phase_code ) "Phase"  '||
329                 '      , DECODE( status_code, ''A'', ''Waiting'', '||
330                 '                             ''B'', ''Resuming'', '||
331                 '                             ''C'', ''Normal'', '||
332                 '                             ''D'', ''Cancelled'', '||
333                 '                             ''E'', ''Error'', '||
334                 '                             ''G'', ''Warning'', '||
335                 '                             ''H'', ''On Hold'', '||
336                 '                             ''I'', '' Normal'', '||
337                 '                             ''M'', ''No Manager'', '||
338                 '                             ''P'', ''Scheduled'', '||
339                 '                             ''Q'', ''Standby'', '||
340                 '                             ''R'', ''  Normal'', '||
341                 '                             ''S'', ''Suspended'', '||
342                 '                             ''T'', ''Terminating'', '||
343                 '                             ''U'', ''Disabled'', '||
344                 '                             ''W'', ''Paused'', '||
345                 '                             ''X'', ''Terminated'', '||
346                 '                             ''Z'', ''Waiting'', '||
347                 '                status_code ) "Status"  '||
348                 '      , hold_flag "Hold"  '||
349                 '      , TO_CHAR( request_date, ''DD-MON-RR HH24:MI'' ) "Request Date"  '||
350                 '      , TO_CHAR( requested_start_date, ''DD-MON-RR HH24:MI'' ) "Requested Start|Date"  '||
351                 '      , resubmitted "Resubmitted"  '||
352                 '      , resubmit_interval "Resubmit|Interval"  '||
353                 '      , resubmit_interval_unit_code "Resubmit Interval|Unit Code"  '||
354                 '      , resubmit_time "Resubmit|Time"  '||
355                 '      , completion_text "Completion Text"  '||
356                 '   FROM fnd_concurrent_requests fcr, fnd_concurrent_programs fcp  '||
357                 '  WHERE fcp.concurrent_program_name = '''||l_conc_prg||''''||
358                 '    AND fcp.concurrent_program_id = fcr.concurrent_program_id  '||
359                 '    AND fcp.application_id = fcr.program_application_id  ';
360        dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt,'Concurrent request information');
361    end if;
362 
363 elsif l_script ='debug' then
364    sqltxt :='SELECT b.user_profile_option_name "Long Name"  '||
365             '    , a.profile_option_name "Short Name"  '||
366             '    , DECODE( c.level_id, 10001, ''Site''  '||
367             '                        , 10002, ''Application''  '||
368             '                        , 10003, ''Responsibility''  '||
369             '                        , 10004, ''User''  '||
370             '                        , ''Unknown'') "Level"  '||
371             '    , DECODE( c.level_id, 10001, ''Site''  '||
372             '                        , 10002, NVL(h.application_short_name,  '||
373             '                                     TO_CHAR( c.level_value))  '||
374             '                        , 10003, NVL(g.responsibility_name,  '||
375             '                                     TO_CHAR( c.level_value))  '||
376             '                        , 10004, NVL(e.user_name,  '||
377             '                                     TO_CHAR(c.level_value))  '||
378             '                        , ''Unknown'') "Level Value"  '||
379             '    , c.profile_option_value "Profile Value"  '||
380             '    , TO_CHAR( c.last_update_date,''DD-MON-YYYY HH24:MI'')  '||
381             '      "Updated Date"  '||
382             '    , NVL(d.user_name, TO_CHAR( c.last_updated_by)) "Updated By"  '||
383             ' FROM fnd_profile_options a  '||
384             '    , fnd_profile_options_vl b  '||
385             '    , fnd_profile_option_values c  '||
386             '    , fnd_user d , fnd_user e  '||
387             '    , fnd_responsibility_vl g  '||
388             '    , fnd_application h  '||
389             'WHERE a.profile_option_name = b.profile_option_name  '||
390             '  AND a.profile_option_id = c.profile_option_id  '||
391             '  AND a.application_id = c.application_id  '||
392             '  AND c.last_updated_by = d.user_id (+)  '||
393             '  AND c.level_value = e.user_id (+)  '||
394             '  AND c.level_value = g.responsibility_id (+)  '||
395             '  AND c.level_value = h.application_id (+)  '||
396             '  AND a.profile_option_name IN (  '||
397             '      ''AFLOG_ENABLED'' , ''AFLOG_FILENAME'' , ''AFLOG_LEVEL''  '||
398             '    , ''AFLOG_MODULE''  '||
399             '    , ''CONC_DEBUG'' , ''FND_AS_MSG_LEVEL_THRESHOLD''  '||
400             '    , ''FLEXFIELDS:VALIDATE_ON_SERVER''  '||
401             '    , ''FND_APPS_INIT_SQL'' , ''FND_INIT_SQL''  '||
402             '    , ''INV_DEBUG_FILE'' , ''INV_DEBUG_LEVEL''  '||
403             '    , ''INV_DEBUG_TRACE'' , ''MRP_DEBUG'' , ''MRP_TRACE''  '||
404             '    , ''MWA_DEBUG_LEVEL'' , ''MWA_DEBUG_TRACE''  '||
405             '    , ''OE_DEBUG_LEVEL'' , ''OE_DEBUG_LOG_DIRECTORY''  '||
406             '    , ''OE_RPC_DEBUG_FLAGS'' , ''ONT_DEBUG_LEVEL''  '||
407             '    , ''PO_RVCTP_ENABLE_TRACE''  '||
408             '    , ''PO_SET_DEBUG_CONCURRENT_ON''  '||
409             '    , ''PO_SET_DEBUG_WORKFLOW_ON'' , ''RCV_DEBUG_MODE''  '||
410             '    , ''RCV_DEBUG_MODE'' , ''RCV_TP_MODE''  '||
411             '    , ''SO_DEBUG'' , ''SO_DEBUG_TRACE''  '||
412             '    , ''WIP_CONC_MESSAGE_LEVEL''  '||
413             '    , ''WSH_DEBUG_LOG_DIRECTORY'' , ''WSH_DEBUG_MODE''  '||
414             '        )  '||
415             'ORDER BY b.user_profile_option_name, c.level_id';
416    dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt,'Debug- and Trace-related profileoptions');
417 
418    sqltxt :='SELECT name, value  '||
419             'FROM v$parameter  '||
420             'WHERE UPPER( name ) IN ( ''UTL_FILE_DIR'', ''USER_DUMP_DEST'', ''MAX_DUMP_FILE_SIZE'' )';
421    dummy_num:= JTF_DIAGNOSTIC_COREAPI.display_sql(sqltxt,'DB parameters : UTL_FILE_DIR , USER_DUMP_DEST and MAX_DUMP_FILE_SIZE');
422 end if;
423  -- construct report
424  statusStr := 'SUCCESS';
425  isFatal := 'FALSE';
426  report := JTF_DIAGNOSTIC_ADAPTUTIL.constructReport(statusStr,errStr,fixInfo,isFatal);
427  reportClob := JTF_DIAGNOSTIC_ADAPTUTIL.getReportClob;
428 
429 END runTest;
430 
431 PROCEDURE getComponentName(name OUT NOCOPY VARCHAR2) IS
432 BEGIN
433 name := 'D Information';
434 END getComponentName;
435 
436 PROCEDURE getTestDesc(descStr OUT NOCOPY VARCHAR2) IS
437 BEGIN
438 descStr := 'Get Environment Information';
439 END getTestDesc;
440 
441 PROCEDURE getTestName(name OUT NOCOPY VARCHAR2) IS
442 BEGIN
443 name := 'Environment Information';
444 END getTestName;
445 
446 PROCEDURE getDependencies (package_names OUT NOCOPY JTF_DIAG_DEPENDTBL) IS
447 tempDependencies JTF_DIAG_DEPENDTBL;
448 
449 BEGIN
450     package_names := JTF_DIAGNOSTIC_ADAPTUTIL.initDependencyTable;
451 END getDependencies;
452 
453 PROCEDURE isDependencyPipelined (str OUT NOCOPY VARCHAR2) IS
454 BEGIN
455   str := 'FALSE';
456 END isDependencyPipelined;
457 
458 
459 PROCEDURE getOutputValues(outputValues OUT NOCOPY JTF_DIAG_OUTPUTTBL) IS
460   tempOutput JTF_DIAG_OUTPUTTBL;
461 BEGIN
462   tempOutput := JTF_DIAGNOSTIC_ADAPTUTIL.initOutputTable;
463   outputValues := tempOutput;
464 EXCEPTION
465  when others then
466  outputValues := JTF_DIAGNOSTIC_ADAPTUTIL.initOutputTable;
467 END getOutputValues;
468 
469 
470 PROCEDURE getDefaultTestParams(defaultInputValues OUT NOCOPY JTF_DIAG_INPUTTBL) IS
471 tempInput JTF_DIAG_INPUTTBL;
472 BEGIN
473 tempInput := JTF_DIAGNOSTIC_ADAPTUTIL.initinputtable;
474 tempInput := JTF_DIAGNOSTIC_ADAPTUTIL.addInput(tempInput,'CheckName','LOV-oracle.apps.inv.diag.lov.EnvSetupLov');
475 tempInput := JTF_DIAGNOSTIC_ADAPTUTIL.addInput(tempInput,'ApplicationId','LOV-oracle.apps.inv.diag.lov.AppLov');
476 tempInput := JTF_DIAGNOSTIC_ADAPTUTIL.addInput(tempInput,'Package','');
477 tempInput := JTF_DIAGNOSTIC_ADAPTUTIL.addInput(tempInput,'FileName','');
478 tempInput := JTF_DIAGNOSTIC_ADAPTUTIL.addInput(tempInput,'PatchNum','');
479 tempInput := JTF_DIAGNOSTIC_ADAPTUTIL.addInput(tempInput,'ConcurrentProgram','');
480 defaultInputValues := tempInput;
481 EXCEPTION
482 when others then
483 defaultInputValues := JTF_DIAGNOSTIC_ADAPTUTIL.initinputtable;
484 END getDefaultTestParams;
485 
486 Function getTestMode return INTEGER IS
487 BEGIN
488  return JTF_DIAGNOSTIC_ADAPTUTIL.ADVANCED_MODE;
489 
490 END getTestMode;
491 
492 END;