Sunteți pe pagina 1din 6

Steps to be performed on ADMPRD

=======================================
1. Connect to adprd from hqidlofiap80
ssh hqidlofiap80
su - oracle
sqlplus ofi/of1@admprd
2. truncate table ofi.ad_applied_patches_custom

Steps to be performed on EACH database


==========================================

3. connect to DEV12 as system user.


------------------------------------
insert into ad_applied_patches_custom@patch.hqh.intra.aexp.com
( select distinct a.APPLIED_PATCH_ID,
a.RAPID_INSTALLED_FLAG,
a.PATCH_NAME,
a.PATCH_TYPE,
a.MAINT_PACK_LEVEL,
a.SOURCE_CODE,
a.CREATION_DATE,
a.CREATED_BY,
a.LAST_UPDATE_DATE,
a.LAST_UPDATED_BY,
a.IMPORTED_FLAG,
a.IMPORTED_FROM_DB,
a.IMPORTED_ID,
a.MERGE_DATE,
a.DATA_MODEL_DONE_FLAG,
'DEV12',
c.PATCH_ABSTRACT,
d.application_short_name
from
apps.ad_applied_patches a,
apps.ad_bugs b,
apps.ad_patch_drivers c,
apps.ad_patch_run_bugs d
where
a.patch_name=b.bug_number and
a.applied_patch_id=c.applied_patch_id and
b.aru_release_name='R12' and
a.creation_date > to_date('01-JAN-09','DD-MON-YY') and
b.bug_id=d.bug_id);

4. connect to TST12 as system user.


-------------------------------------
insert into ad_applied_patches_custom@patch.hqh.intra.aexp.com
( select distinct a.APPLIED_PATCH_ID,
a.RAPID_INSTALLED_FLAG,
a.PATCH_NAME,
a.PATCH_TYPE,
a.MAINT_PACK_LEVEL,
a.SOURCE_CODE,
a.CREATION_DATE,
a.CREATED_BY,
a.LAST_UPDATE_DATE,
a.LAST_UPDATED_BY,
a.IMPORTED_FLAG,
a.IMPORTED_FROM_DB,
a.IMPORTED_ID,
a.MERGE_DATE,
a.DATA_MODEL_DONE_FLAG,
'TST12',
c.PATCH_ABSTRACT,
d.application_short_name
from
apps.ad_applied_patches a,
apps.ad_bugs b,
apps.ad_patch_drivers c,
apps.ad_patch_run_bugs d
where
a.patch_name=b.bug_number and
a.applied_patch_id=c.applied_patch_id and
b.aru_release_name='R12' and
a.creation_date > to_date('01-JAN-09','DD-MON-YY') and
b.bug_id=d.bug_id);
5. connect to TRN12 as system user.
------------------------------------

insert into ad_applied_patches_custom@patch.hqh.intra.aexp.com


( select distinct a.APPLIED_PATCH_ID,
a.RAPID_INSTALLED_FLAG,
a.PATCH_NAME,
a.PATCH_TYPE,
a.MAINT_PACK_LEVEL,
a.SOURCE_CODE,
a.CREATION_DATE,
a.CREATED_BY,
a.LAST_UPDATE_DATE,
a.LAST_UPDATED_BY,
a.IMPORTED_FLAG,
a.IMPORTED_FROM_DB,
a.IMPORTED_ID,
a.MERGE_DATE,
a.DATA_MODEL_DONE_FLAG,
'TRN12',
c.PATCH_ABSTRACT,
d.application_short_name
from
apps.ad_applied_patches a,
apps.ad_bugs b,
apps.ad_patch_drivers c,
apps.ad_patch_run_bugs d
where
a.patch_name=b.bug_number and
a.applied_patch_id=c.applied_patch_id and
b.aru_release_name='R12' and
a.creation_date > to_date('01-JAN-09','DD-MON-YY') and
b.bug_id=d.bug_id);
6. connect to CRP12 as system user.
-------------------------------------
insert into ad_applied_patches_custom@patch.hqh.intra.aexp.com
( select distinct a.APPLIED_PATCH_ID,
a.RAPID_INSTALLED_FLAG,
a.PATCH_NAME,
a.PATCH_TYPE,
a.MAINT_PACK_LEVEL,
a.SOURCE_CODE,
a.CREATION_DATE,
a.CREATED_BY,
a.LAST_UPDATE_DATE,
a.LAST_UPDATED_BY,
a.IMPORTED_FLAG,
a.IMPORTED_FROM_DB,
a.IMPORTED_ID,
a.MERGE_DATE,
a.DATA_MODEL_DONE_FLAG,
'CRP12',
c.PATCH_ABSTRACT,
d.application_short_name
from
apps.ad_applied_patches a,
apps.ad_bugs b,
apps.ad_patch_drivers c,
apps.ad_patch_run_bugs d
where
a.patch_name=b.bug_number and
a.applied_patch_id=c.applied_patch_id and
b.aru_release_name='R12' and
a.creation_date > to_date('01-JAN-09','DD-MON-YY') and
b.bug_id=d.bug_id);
7. connect to OSIDEV as system user.
---------------------------------------
insert into ad_applied_patches_custom@patch.hqh.intra.aexp.com
( select distinct a.APPLIED_PATCH_ID,
a.RAPID_INSTALLED_FLAG,
a.PATCH_NAME,
a.PATCH_TYPE,
a.MAINT_PACK_LEVEL,
a.SOURCE_CODE,
a.CREATION_DATE,
a.CREATED_BY,
a.LAST_UPDATE_DATE,
a.LAST_UPDATED_BY,
a.IMPORTED_FLAG,
a.IMPORTED_FROM_DB,
a.IMPORTED_ID,
a.MERGE_DATE,
a.DATA_MODEL_DONE_FLAG,
'OSIDEV',
c.PATCH_ABSTRACT,
d.application_short_name
from
apps.ad_applied_patches a,
apps.ad_bugs b,
apps.ad_patch_drivers c,
apps.ad_patch_run_bugs d
where
a.patch_name=b.bug_number and
a.applied_patch_id=c.applied_patch_id and
b.aru_release_name='R12' and
a.creation_date > to_date('01-JAN-09','DD-MON-YY') and
b.bug_id=d.bug_id);
8.connect to OSITST as system user.
------------------------------------

insert into ad_applied_patches_custom@patch.hqh.intra.aexp.com


( select distinct a.APPLIED_PATCH_ID,
a.RAPID_INSTALLED_FLAG,
a.PATCH_NAME,
a.PATCH_TYPE,
a.MAINT_PACK_LEVEL,
a.SOURCE_CODE,
a.CREATION_DATE,
a.CREATED_BY,
a.LAST_UPDATE_DATE,
a.LAST_UPDATED_BY,
a.IMPORTED_FLAG,
a.IMPORTED_FROM_DB,
a.IMPORTED_ID,
a.MERGE_DATE,
a.DATA_MODEL_DONE_FLAG,
'OSITST',
c.PATCH_ABSTRACT,
d.application_short_name
from
apps.ad_applied_patches a,
apps.ad_bugs b,
apps.ad_patch_drivers c,
apps.ad_patch_run_bugs d
where
a.patch_name=b.bug_number and
a.applied_patch_id=c.applied_patch_id and
b.aru_release_name='R12' and
a.creation_date > to_date('01-JAN-09','DD-MON-YY') and
b.bug_id=d.bug_id);
9.connect to OSIUAT as system user.
-------------------------------------

insert into ad_applied_patches_custom@patch.hqh.intra.aexp.com


( select distinct a.APPLIED_PATCH_ID,
a.RAPID_INSTALLED_FLAG,
a.PATCH_NAME,
a.PATCH_TYPE,
a.MAINT_PACK_LEVEL,
a.SOURCE_CODE,
a.CREATION_DATE,
a.CREATED_BY,
a.LAST_UPDATE_DATE,
a.LAST_UPDATED_BY,
a.IMPORTED_FLAG,
a.IMPORTED_FROM_DB,
a.IMPORTED_ID,
a.MERGE_DATE,
a.DATA_MODEL_DONE_FLAG,
'OSIUAT',
c.PATCH_ABSTRACT,
d.application_short_name
from
apps.ad_applied_patches a,
apps.ad_bugs b,
apps.ad_patch_drivers c,
apps.ad_patch_run_bugs d
where
a.patch_name=b.bug_number and
a.applied_patch_id=c.applied_patch_id and
b.aru_release_name='R12' and
a.creation_date > to_date('01-JAN-09','DD-MON-YY') and
b.bug_id=d.bug_id);

========================================
Steps to be performed on ADMPRD
=======================================
10. Connect to adprd from hqidlofiap80
---------------------------------------
ssh hqidlofiap80
su - oracle
sqlplus ofi/of1@admprd

10.1) truncate table show_patch_details;


10.2) alter session set nls_Date_format='DD-MON-RR HH:MI:SS AM';
10.3) In the same session, run the below pl/sql
declare
dml_str varchar2 (2000);
cnt number;
cursor c1 is
select distinct instance_name from ad_applied_patches_custom order by 1;
cursor c2 (p_instance_name varchar2) is
select distinct patch_name,creation_date,patch_abstract,application_short_name f
rom ad_applied_patches_custom where instance_name=p_instance_name;
begin
for r1 in c1 loop
for r2 in c2(r1.instance_name) loop
begin
select 1 into cnt from show_patch_details where patch_na
me=r2.patch_name;
EXCEPTION
WHEN NO_DATA_FOUND THEN
dml_str:='insert into show_patch_details (patch_name, '|
| r1.instance_name||', patch_abstract, application_short_name) values ('''||r2.p
atch_name||''', to_date('''||r2.creation_date||''',''DD-MON-RR HH:MI:SS AM''),''
'||replace(r2.patch_abstract,'''','')||''','''||r2.application_short_name||''')'
;
dbms_output.put_line(dml_str);
execute immediate dml_str;
end;
dbms_output.put_line('Hello '||to_char(cnt));
if cnt is not null then
dml_str:='update show_patch_details set '|| r1.instance_
name||' = to_date('''||r2.creation_date||''',''DD-MON-RR HH:MI:SS AM''), applica
tion_short_name= '''|| r2.application_short_name||''' where patch_name = '''||r2
.patch_name||'''';
dbms_output.put_line(dml_str);
execute immediate dml_str;
end if;
end loop;
end loop;
commit;
end;
/
commit;
10.4)
select patch_name,upper(application_short_name),patch_abstract,DEV12,TST12,TRN12
,CRP12,OSIDEV,OSITST,OSISIT,OSIUAT,QA,OFI from ofi.show_patch_details;