Thursday, August 5, 2010

Patching related questions

Patching related questions

Prereq not met while patching.

In this case the patch ultimately fails.

Solution:
========
1) Immediately take a backup of restart files which contains the current patch/failed patch information.
2) Take a backup of AD_DEFFERED_JOBS and FND_INSTALL_PROCESSES tables if they exist, and drop them.
3) Check which pre-requisite you haven't applied.
4) Download and apply the pre-requisite.
5) Once it is successfully applied, restore the failed patch restart files and the tables which are backed up.
6) Run adpatch and continue from the previous session.

NOTE:-This is usually followed if a large patch fails after running for a long time. Say if a patch fails immediately after applying, you can go for reapplying the patch freshly after all the prerequisites are met.

Apply only the database portion of a unified Driver
$ adpatch options=nocopyportion,nogenerateportion

At the prompt for the driver name, specify the unified (u) driver. AutoPatch runs the driver, applying only the database portion of the patch.

Enabling Password Validation
adpatch options=validate

AD_BUGS holds information about the various Oracle Applications bugs whose fixes have been applied (ie. patched) in the Oracle Applications installation.

AD_APPLIED_PATCHES (ie OAM) holds information about the "distinct" Oracle Application patches that have been applied. If 2 patches happen to have the same name but are different in content (eg. "merged" patches), then they are considered distinct and this table will therefore hold 2 records

the patches on OAM take the values from ad_applied_patches, while it stores the values of bug in the ad_bugs.

REAPPLY PATCH:
AD_BUGS--will give you information about the bug fixes in the system
(AD_PATCH_RUN_BUGS will also do the same)

AD_APPLIED_PATCHES--will give you information about the patches appplied to the system.
Say if you have a ROLLUP patch or a patchset, which will fix many small bug fixes, AD_APPLIED_PATCHES will have only the patch number,
but
AD_BUGS(AD_PATCH_RUN_BUGS) will have all the bug fixes by that particular patch.

Use AD_PATCH_RUN_BUGS.

STATUS OF A PATCH:

ps -ef | grep adpatch and if it returns, the patch is still running
adadmin and adctrl

Applying a main patch, which fails for a pre-req patch, and now you want to apply the pre-req patch to resolve the error but DONOT want to skip the main patch??

1. Using the adctrl utility, shutdown the workers of the main patch.
a. adctrl
b. Select option 3 "Tell worker to shutdown/quit"

2. Backup the FND_INSTALL_PROCESSES table which is owned by the APPLSYS schema
a. sqlplus applsys/
b. create table fnd_Install_processes_back
as select * from fnd_Install_processes;
c. The 2 tables should have the same number of records.
select count(*) from fnd_Install_processes_back;
select count(*) from fnd_Install_processes;

3. Backup the AD_DEFERRED_JOBS table.
a. sqlplus applsys/
b. create table AD_DEFERRED_JOBS_back
as select * from AD_DEFERRED_JOBS;
c. The 2 tables should have the same number of records.
select count(*) from AD_DEFERRED_JOBS_back;
select count(*) from AD_DEFERRED_JOBS;

4. Backup the .rf9 files located in $APPL_TOP/admin//restart directory.
At this point, the adpatch session should have ended and the cursor should
be back at the Unix prompt.
a. cd $APPL_TOP/admin/
b. mv restart restart_back
c. mkdir restart

5. Drop the FND_INSTALL_PROCESSES table and the AD_DEFERRED_JOBS table.
a. sqlplus applsys/
b. drop table FND_INSTALL_PROCESSES;
c. drop table AD_DEFERRED_JOBS;

6. Apply the new patch.- The pre-req patch which was missed.

7. Restore the .rf9 files located in $APPL_TOP/admin//restart_back
directory.
a. cd $APPL_TOP/admin/
b. mv restart restart_
c. mv restart_back restart

8. Restore the FND_INSTALL_PROCESSES table which is owned by the APPLSYS
schema.
a. sqlplus applsys/
b. create table fnd_Install_processes
as select * from fnd_Install_processes_back;
c. The 2 tables should have the same number of records.
select count(*) from fnd_Install_processes;
select count(*) from fnd_Install_processes_back;

9. Restore the AD_DEFERRED_JOBS table.
a. sqlplus applsys/
b. create table AD_DEFERRED_JOBS
as select * from AD_DEFERRED_JOBS_back;
c. The 2 tables should have the same number of records.
select count(*) from AD_DEFERRED_JOBS_back;
select count(*) from AD_DEFERRED_JOBS;

10. Re-create synonyms
a. sqlplus apps/apps
b. create synonym AD_DEFERRED_JOBS for APPLSYS.AD_DEFERRED_JOBS;
c. create synonym FND_INSTALL_PROCESSES FOR APPLSYS.FND_INSTALL_PROCESSES;

11. Start adpatch, it will resume where it stopped previously.

No comments:

Post a Comment