Sunday, July 22, 2007

ADPATCH with "options=prereq" - what really happens there?

With adpatch utility we have a possibility to ask for a prerequisite check prior to running patch driver files.
Actually, some patches must apply with prerequisite check before applying them.

The adpatch command should look like: adpatch option=prereq
This flag indicate to adpatch to check prerequisite before applying patch.

adpatch checks the prerequisite based on information from patch files and current snapshot on APPL_TOP.

When running adpatch with "prereq" flag, we might get an error message like:
Analyzing prerequisite patch information...
AutoPatch error: This patch has some prerequisites specified, but a "snapshot" of this APPL-TOP's file-system has never been taken, thereby rendering it impossible to check for the prerequisites.
Please take a "snapshot" of this APPL-TOP using "AD Administration" first.


This error message will show up if a snapshot on current APPL_TOP doesn't exists.

To create such snapshot on APPL_TOP:
1) run adadmin
2) Select "Maintain Applications Files menu"
3) Select "Update current view snapshot"
4) Rerun adpatch

**It might take couple of hours depends on your hardware and APPL_TOP size.


So how adpatch check the prerequisites?

1) Check if a snapshot on current APPL_TOP exist.
using sql script - adbkflsn.sql (if not, will terminate with above error message.....)

2) adpatch uploads a ldt file with FNDLOAD utility into system (bug-fixes).
ldt file name is: b[PATCH_NUMER].ldt - comes from patch root directory.

3) Execute the UMS analysis engine based on the snapshot and bug-fixes to check if all prerequisites exists.

You are welcome to leave a comment...

12 comments:

Anonymous said...

Thanks Aviad,actually it is a very nice topic.
BR

Aviad said...

Thanks for commenting :-)

Aviad

Mostafa said...

- where are the "snapshots" of the APPL-TOP's stored in the file-system?
- What are their file-name(s) and file(s) path?

Aviad said...

The snapshot stored in: $APPL_TOP/admin/[SID]/out
The file name is: snapshot.txt

Regards,
Aviad

Mostafa said...

- I only found $APPL_TOP/admin/[SID]/out/snapdnld.txt
- No snapshot.txt
- is this a different version?

Aviad said...

While the "Update current view snapshot" is running the snapshot file name is snapshot.txt, but when it comes to an end the snapshot.txt file changes to snapdnld.txt.

Anonymous said...

Hi Aviad,
how about using the UMS analysis engine alone?
parameter like :
p_appl_top_id =
appl_top_name =
.
.
?

Unknown said...

Hi Aviad,
thanks for your information.

Usually when we apply the patches,we add some options like nocompiledb,noautoconfig,nocompilejsp and so on.I'm not very sure when we need to add these options.I can open the drv file and find that there will be some actions,such as copy,generate..If there is a action copying sql to system,should we use compiledb option(default) not nocompiledb?

hope your reply
Ivan

Aviad said...

Hi Ivan (Big-Tree),

Basically you shouldn’t use any of nocompiledb, noautoconfig, nocompilejsp options when applying patches.
Those options should be used very carefully as they can make patch application incomplete.

Nocompiledb
===========
Tells adpatch to compile invalid database objects after patch applied.
Should be used when applying documentation patches or when applying multiple patches and it’s important to save time (so compiledb once with the last patch).

Nocompilejsp
===========
Tells adpatch to compile out of date jsp’s.
Should be used when applying multiple patches and it’s important to save time (so compilejsp once with the last patch).

Noautoconfig
============
Tells adpatch to run AutoConfig automatically.
Should be used when applying multiple patches and it’s important to save time (so autoconfig once with the last patch).

HTH,
Aviad

Anonymous said...

Hi,

It's better to use the adpatch option=prereq whenever we apply a patch just to make sure that we have all the prerequisites patches applied?

In addition, I could not find snapshot.txt or snapdnld.txt in $APPL_TOP/admin/[SID]/out. What may be happening?

Thanks!

Anonymous said...

Hi

It much more simple to check patch prerequisites manually from ad_bugs or use Patchdepends tool(www.patchdepends.com ) ,because you need to run snapshot before every patch you apply and I had a lot of problem with options=prereq with obsolete patches.

Anonymous said...

Hi

It much more easier to use select from ad_bugs or user Patchdepends tool to check patch prerequisites because it time consuming to create snapshot. I had a lot of problem with options=prereq with obsolete patches.