Thursday 27 June 2013

How to apply a patch in oracle ebs R12?


check patch is applied or not if not download from metalink
===========================================================
select bug_number,creation_date from apps.ad_bugs where bug_number='&bug_number';

check how many langagues are installed
=======================================

col LANGUAGE_CODE for a20
col NLS_LANGUAGE for a20
select NLS_LANGUAGE,LANGUAGE_CODE,INSTALLED_FLAG from apps.fnd_languages where INSTALLED_FLAG in('B','I');
NLS_LANGUAGE LANGUAGE_CODE INS
-------------------- -------------------- ---
AMERICAN US B
BRAZILIAN PORTUGUESE PTB I

OR
cd $AU_TOP/forms

Invalid objects before applying the patch
======================================
select count(*) from dba_objects where status='INVALID';
25

Backuping the invalids object before applying the patch if needed.
=================================================================
create table dba_objects_18apr2013 AS select * from dba_objects where status='INVALID';

if you have multiple patches Please merge it by using below command
====================================================================
Go to patch directory and create below directories
cd /u01/ebsapp/patches/CHGER0214234
mkdir before after
chmod 777 *
Now merge patch using below command
===================================
You should fire this command from CHGER0214234.

ls -trl /u01/ebsapp/patches/CHGER0214234/before/*.zip|awk '{print $NF}' > patch_list

admrgpch -s before -d after -merge_name 0214234 -manifest patch_list

above command merge the patch and go to after directory you will find merge driver file.

send outage communication/Put mail to business
so that they will get to know instance went down
for patching.
============================================
Bring down middle tier/apps tier services
11i==============>cd $COMMON_TOP/admin/scripts/$CONTEXT_NAME
r12==============>cd $INST_TOP/admin/scripts
ps -fu applmgr|grep -i http


if it is shared application file system
========================================
you have to bring down admin tier service i.e, concurrent node it depends on business requirement.
ps -fu applmgr|grep -i FND|wc -l

if processes not went down do kill processes and proceed ahead
===============================================================
kill -9 procid

Enable the maintanace mode
===========================
sqlplus -s apps/******** @$AD_TOP/patch/115/sql/adsetmmd.sql ENABLE

To check maintanace mode enable or not use below query
=======================================================
select fnd_profile.value('APPS_MAINTENANCE_MODE') from dual;


Now fire adpatch from VNC server as its process will be created on the server.
You can also use putty session but this process will run at client side.Putty
session will be inactive after 30 mins.if your patch taking more than 30 mins
your session will gone.you have to start adpatch from the start.

So its better practice to use VNC.




FIRE :adpatch
as adpatch will ask for some questions like logfile name,system,apps,ORACLE_HOME,number worker,driver file
once the patch is applied successfully.Please check the logfile for errors and warnings.

To check adpatch log
cd $APPL_TOP/admin/$TWO_TASK/log.


grep -i errors $APPL_TOP/admin/$TWO_TASK/log/0214234.log
grep -i warnings $APPL_TOP/admin/$TWO_TASK/log/0214234.log
grep -i failed $APPL_TOP/admin/$TWO_TASK/log/0214234.log

Please check whether patch is applied or not.
===============================================
select bug_number,creation_date from ad_bugs where bug_number='5968480';
BUG_NUMBER CREATION_DATE
------------------------------ ---------------
14072764 18-APR-12

Disable the maintainance mode
=========================================
sqlplus -s apps/****** @$AD_TOP/patch/115/sql/adsetmmd.sql DISABLE


To check maintanace mode enable or not use below query
=======================================================
select fnd_profile.value('APPS_MAINTENANCE_MODE') from dual;




Up the DT services and then AT services
======================================
11i==============>cd $COMMON_TOP/admin/scripts/$CONTEXT_NAME
R12==============>cd $INST_TOP/admin/scripts (OR) $ADMIN_SCRIPTS_HOME

do sanity check and release instance for user access .
http://appoltp.user.com:8011/OA_HTML/AppsLocalLogin.jsp
In sanity check you will sumbit below to requests

Go to System adminstrator --->Request--->Run

1)Active User =====>Check View LOG/vIEW OUT
2)Active Responsiblity ===>Check View LOG/vIEW OUT


Invalid objects after applying the patch
=========================================
SQL> select count(*) from dba_objects where status='INVALID';
COUNT(*)
----------
16
Backuping the invalids object after applying the patch
====================================================
SQL> create table dba_objects_18apr2012_after AS select * from dba_objects where status='INVALID';
Table created.


To find new invalid objects
============================
SQL> select count(1) from dba_objects where object_id not in (select object_id from dba_objects_18apr2013) and status='INVALID';
COUNT(1)
----------
0
SQL>


***************************************************************
Happy reading !!!!!!!

No comments:

Post a Comment