Monday, November 23, 2015

Applying Application Patches to Oracle EBS 11i/R12 Applications

Applying Application Patches to Oracle EBS 11i/R12 Applications

Step 1: Before applying a patch you must check whether the patch is applied or not:

Method 1:

For this we query the database:

Sqlplus apps/<apps_password>

Sql> select bug_id, bug_number from ad_bugs where bug_number='&num';

Sql> select patch_type, patch_name from ad_applied_patches where patch_name='&num';

Method 2:

Checked with OAM
a) Connect to OAM
b) Go to System Administrator --> OAM-->Dashboard --> Site map --> Maintenance --> Applied patches
c) Enter patch id and press ‘Go’
d) See if patch was returned

Step 2: Download the patch:

Example:

www.support.oracle.com

Step 3: Unzip the patch:

Exapmple: Command: 

Unzip < patch.zip>

Step 4: Before applying patch:(check invalid objects in DB) and Backup the invalids object before applying the patch:

Example:

Sql> select name from v$database;

Sql>select owner,count(*) from dba_objects where status='INVALID' group by owner; 

Backup the invalids with CTAS:

create table dba_objects_18apr2013 AS select * from dba_objects where status='INVALID';

Note:
Send outage communication/put mail to business

Step 5: Stop all application services (If we don’t want to close application services, we have hot patch option:

Note: 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

Step 6: Enable Maintenance mode

Example:

$ adadmin

5. change maintenance mode

To check maintenance mode enable or not use below query

select fnd_profile.value('APPS_MAINTENANCE_MODE') from dual;

If  the status:

“MAINT” = MAINTENANCE MODE HAS BEEN ENABLED AND THE USERS WILL NOT BE ABLE TO LOGIN.

“NORMAL” = MAINTENANCE MODE HAS BEEN DE-ACTIVATED AND THE USERS WILL BE ABLE TO LOGIN.

Reasons For Enabling Maintenance Mode:

To ensure optimal performance and reduce downtime during patching sessions, AutoPatch requires that you enable Maintenance mode when you apply a patch. Enabling this feature shuts down the Workflow Business Events System and sets up function security so that Oracle Applications functions are unavailable to users. This provides a clear separation between normal runtime operation and system downtime for patching.

Note:
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 it's better practice to use VNC.

Step 7: Applying patch using ‘adpatch’ (auto patch utility):

FIRE :adpatch
as adpatch will ask for some questions like logfile name,system,apps,ORACLE_HOME,number of worker,driver file, once the patch is applied successfully. Please check the logfile for errors and warnings.
Use adpatch by going to patch directory
Go to the patch top directory,where all driver and required ldt files are present with the application file system owner,makes sure all files have read,write and execute permission.

As described below:

Note:It is very important to review the readme.txt in unix vi editor before applying applying patch and follow the instruction as given in the readme.txt file and apply any pre-requistics patch if required. Autoconfig run also not required unless it is specified after patch installation in readme.txt file. After this answer the questions of autopatch. As autopatch finishes its tasks, it writes timing information to the AD timing report for jobs running in parallel (if any ) and reminds you to run the log files for any errors.
If you don’t see the “autopatch is complete” message at the end of the Autopatch log file, Autopatch did not complete successfully.
The most important step after autopatch completes is to check the log files for any errors that may occurred during the patching process. Check the main Autopatch log file first,then additional log files as necessary.
The default name of main autopatch log file is adpatch.log .The file is located in
$APPL_TOP/admin/<SID>/log

Step 8 : Please check whether patch is applied or not.

Step 9: Disable Maintenance mode again by using 'adadmin' utility:

Step 10: Start application services :

Step 11:After applying PATCH:

step a:Verify the patch is applied successfully:

SQL> select name from v$database;

NAME
---------
TESTDB

SQL> select bug_number,creation_date from ad_bugs where bug_number='5522470';

BUG_NUMBER                     CREATION_DATE
------------------------------ ---------------
5549427                        12-FEB-13

Step b:Run cmclean.sql

Run cmclean.sql from application node by going to $COMMON_TOP/admin/scipts/TESTDB_ebstest in 11i,where as in R12 goto $ADMIN_SCRIPTS_HOME or $INST_TOP/admin/scripts
commit;
Note:We run cmclean after clonning also to make sure the node name is updated in the FND_NODES Table correctly

SQL> select owner,count(*) from dba_objects where status='INVALID' group by owner;

OWNER                            COUNT(*)
------------------------------ ----------
SYS                                     1
TEST_USER1                    2
TEST_USER2                    5
APPS                                 22

Step c:Check the file versions got changed successfully after applying patch:

strings -a POXWARMB.pls|grep Header =>Can be used to check the file version.

Step d:Do the Health Check of Oracle EBS Application

Note :We can get HOME page URL by using below query:
SQL>Select Home_URL from icx_parameter;

Health check completed successfully by submitting active user Concurrent request REQUEST ID 28758820.

Step e:Intimate end User 

Make sure you intimate the end User or release your application to the end User 

do sanity check and release instance for user access .
In sanity check you will submit below two requests:

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

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


In Oracle, to apply database patch we use ‘opatch‘ ($ORACLE_HOME/OPatch) where as in order to apply applications patch we use ad utility ‘adpatch‘ ($AD_TOP/bin).
Patch Zipped File Details: When you unzip a patch you will see the following files:readme.txt - This file contain steps to apply the patch, list of prerequisites should be there on apps Instance (If not apply that patch ) cXXXXXXX.drv c stand for copy driver file , this copies patch content to respective patch location , driver is like bus driver which provides instruction on work adpatch need to perform. dXXXXXXX.drv d stand for Database driver & contain content related to database like creating packages, tables, adding column…. gXXXXXXX.drv This contain files related to forms , reports, graphics or messages uXXXXXXX.drv Sometime these three types of files are bundled together into single driver file called Unified driver file

Maintenance Mode/ Hot Patch: Maintenance Mode is mode of operation introduced with AD.I.2, in which the oracle application system is made accessible only for patching activities. Greatly improves performance by minimizing downtime. If you wish to apply patch without putting applications in maintenance mode (for small patches) use options=hotpatch with adpatch.

No comments:

Post a Comment