Thursday, November 16, 2017

How to check If a patch is applied in R12.2

In eBusiness Suite (EBS) 12.2.x you cannot query the AD_BUGS table to check if patches have been applied.The AD_BUGS table may have entries for patches that were applied but later the patching cycle was aborted (not really applied).


To check whether a patch is really applied use the AD_PATCH.IS_PATCH_APPLIED pl/sql function.Using this API is an alternative method for users without access to Oracle Applications Manager's "Patching and Utilities" feature to determine if a certain patch is applied.



Query to Find in single app tier or shared application tier Environment:
select ad_patch.is_patch_applied('R12',-1,20034256) from dual;

Expected results:
EXPLICIT = applied
NOT APPLIED = not applied / aborted


To check Multiple patches,Please use below query:

SELECT adb.bug_number,ad_patch.is_patch_applied('R12',-1, adb.bug_number) FROM ad_bugs adb WHERE adb.bug_number in ('25820806','26720905',
'24591000','26482811','25828573','26400116','26720231','25994411');


To get output in human readable format:
set serveroutput on;
DECLARE
TYPE p_patch_array_type is varray(30) of varchar2(10);
p_patchlist p_patch_array_type;
p_patch_status varchar2(15);
p_appl_top_id number;
p_result varchar2(15);
p_instance varchar2(15);
procedure println(msg in varchar2)
is
begin
dbms_output.enable(1000000);
dbms_output.put_line(msg);
end;
BEGIN
p_patchlist:= p_patch_array_type('25820806','26720905','24591000','26482811','25828573','26400116','26720231','25994411','89989');
println('=============================');
for i in 1..p_patchlist.count
loop
p_patch_status := ad_patch.is_patch_applied('R12',-1,p_patchlist(i));
case p_patch_status
when 'EXPLICIT' then
p_result := 'APPLIED';
else
p_result := p_patch_status;
end case;
println('Patch ' || p_patchlist(i)|| ' - ' || ' - IS ' || p_result);
end loop;
println('.');
END;
/

Query to find patch information  for a specific node in a multinode environment (1045 is the APPL_TOP ID):
Syntax: select AD_PATCH.IS_PATCH_APPLIED(\'$release\',\'$appltop_id\',\'$patch_no\',\'$language\') from dual;

SELECT adb.bug_number,ad_patch.is_patch_applied('R12', 1045, adb.bug_number) FROM ad_bugs adb WHERE adb.bug_number in (20034256);

APPL_TOP_ID -->you cat gen  from ad_appl_tops table.

2 comments:

  1. Thak you very much for sharing your experience. Very helpful scripts!

    Below a more universal query based on your original one "Query to find patch information for a specific node in a multinode environment":

    SELECT adb.bug_number,apt.node_name,ad_patch.is_patch_applied('R12', apt.APPL_TOP_ID, adb.bug_number)
    FROM ad_bugs adb,
    ( select APPL_TOP_ID, n.node_name
    from ad_appl_tops t, fnd_nodes n
    where instr(UPPER(t.NAME),UPPER(n.node_name)) >= 1 ) apt
    WHERE adb.bug_number in ( '&BUG_ID')
    /

    ReplyDelete

How to Compile Forms , Reports & Custom.pll in R12.2

How to Compile Custom.pll   cd $AU_TOP/resource  cp CUSTOM.plx CUSTOM.plx_bkup  cp CUSTOM.pll CUSTOM.pll_bkup  frmcmp_batch module=CUSTOM.pl...